public static float getFontSize() {
Configuration mCurConfig = new Configuration();
try {
mCurConfig.updateFrom(ActivityManagerNative.getDefault().getConfiguration());
} catch (RemoteException e) {
Log.w(TAG, "Unable to retrieve font size");
}
Log.w(TAG, "getFontSize(), Font size is " + mCurConfig.fontScale);
return mCurConfig.fontScale;
}Android 如何获取系统字体大小
最新推荐文章于 2025-09-11 00:15:00 发布
本文介绍了一个用于从设备获取字体大小的公共静态方法,通过ActivityManagerNative接口更新配置并获取字体缩放比例。
861

被折叠的 条评论
为什么被折叠?



