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

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 辅助使用里的字型大小

转载于:https://www.cnblogs.com/onechen/p/6006392.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ModernListView (Berlin, Tokyo [with fix], Rio) 很好的Delphi Firemonkey控件,可用作Android、iOS、MacOS、Windows开发,比Delphi自带的listview更好用、功能更强大! ListView1.SetColorItemSelected(TAlphaColorRec.Orangered); ListView1.SetColorItemFill(TAlphaColorRec.Whitesmoke); ListView1.SetColorItemFillAlt(TAlphaColorRec.Lightgrey); ListView1.SetColorBackground(TAlphaColorRec.Whitesmoke); ListView1.SetColorItemSeparator(TAlphaColorRec.Red); ListView1.SetColorText(TAlphaColorRec.Darkmagenta); ListView1.SetColorTextSelected(TAlphaColorRec.Blueviolet); ListView1.SetColorTextDetail(TAlphaColorRec.Darksalmon); ListView1.SetColorHeader(TAlphaColorRec.Crimson); ListView1.SetColorTextHeader(TAlphaColorRec.Whitesmoke); ListView1.SetColorTextHeaderShadow(TAlphaColorRec.grey); ListView1.SetColorPullRefresh(TAlphaColorRec.Lime); ListView1.SetColorPullRefreshIndicator(TAlphaColorRec.Limegreen); ListView1.SetColorStretchGlow(TAlphaColorRec.Limegreen); Style for ListView Columns Mode ListView1.ShowScrollBar - hide/show scrollbar ListView1.ItemsClearTrue - correct delete items ListView1.OffsetTop - indent of the first element ListView1.OffsetBottom - indent of the last element ListView1.getFirstVisibleItemIndex - first visible ItemIndex ListView1.getVisibleCount - amount of visible items ListView1.getLastVisibleItemindex - first visible ItemIndex + amount of visible items ListView1.SeparatorLeftOffset - indent for separator line ListView1.SeparatorRightOffset - indent for separator line ListView1.EnableTouchAnimation - enable/disable touch animation
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值