-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用了AndroidAutoSize后,系统设置改变字体,切回App, Activity重建,但是布局文件内的字体不会自动适配改变 #447
Comments
看你这日志,影响字体的 targetScaledDensity 变量并没有变啊, |
新增了:AutoSizeConfig.getInstance().setPrivateFontScale(getSystemFontScale()); 仍然无效 |
@Override
public Resources getResources() {
AutoSizeCompat.autoConvertDensityOfGlobal(super.getResources());//如果没有自定义需求用这个方法
AutoSizeCompat.autoConvertDensity(super.getResources(), 667, false);//如果有自定义需求就用这个方法
return super.getResources();
} 加上 getResources 试试。 |
感谢大神,好使了,最终解决方案: Application中:
BaseActivity 中:
这样就能自行改变适配了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Bug Description:
要求App内字体跟随系统设置字体大小改变,使用了AndroidAutoSize后,系统设置改变字体,切回App, Activity重建,但是布局文件内的字体不会自动适配改变。
手动杀死进程重启后字体就会改变了。查看了当前issues列表,没找到对应解决方案,请大神帮忙解惑
Log:
Related Code:
Others:
The text was updated successfully, but these errors were encountered: