首页 > 移动平台 > 详细

[函數] Firemonkey Android 取得系统参数设定的字型大小

时间:2016-10-28 09:35:06      阅读:312      评论:0      收藏:0      [点我收藏+]

Android 系统参数设定内,可以设定字型大小:

技术分享

 

可以透过下面代码来取得字型大小比例:

function FontScale: Single;
var Resources: JResources;
    Configuration: JConfiguration;
begin
     Result := 1;

     if TAndroidHelper.Context <> nil then
     begin
          Resources := TAndroidHelper.Context.getResources;
          if Resources <> nil then
          begin
               Configuration := Resources.getConfiguration;
               if Configuration <> nil then
                  Result := Configuration.fontScale;
          end;
     end;
end;

 

iOS 请参考:

Delphi 取得 iOS 辅助使用里的字型大小

[函數] Firemonkey Android 取得系统参数设定的字型大小

原文:http://www.cnblogs.com/onechen/p/6006392.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!