android - 如何知道用户是否激活了 android 中的 "bigger font"辅助功能选项?

标签 android

如何确定用户是否在 Android 设备的辅助功能页面中激活了“更大的字体”选项?

最佳答案

public float fontScale

Current user preference for the scaling factor for fonts, relative to the base density scaling.

可以获得当前比例:

float scale = getResources().getConfiguration().fontScale;

默认值必须为 1。您可以调试并查看“更大字体”的值。

http://developer.android.com/reference/android/content/res/Configuration.html#fontScale

关于android - 如何知道用户是否激活了 android 中的 "bigger font"辅助功能选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36409936/

相关文章:

android - 延迟后自动更改 fragment 的方法

java - Android Firebase 同步检索数据和 "returning"

android - 无法在索引 3 处绑定(bind)参数,因为索引超出范围。该语句有 1 个参数

Android-使用 html 数据从 textview 获取文本位置

安卓谷歌登录: check if User is signed in

android - Robolectric 在 Android 应用程序中的密码问题

android - 使用图表引擎图的 Intent 时的双 Activity 窗口

android - 将Android SDK从29降级到21

android - 以编程方式登录网站

android - 如何在android中使用相机 Intent 获取图像名称?