We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
用这个方法没用,updateConfiguration也过时了 @Override public Resources getResources() { Resources resources = super.getResources(); if (resources != null) { Configuration configuration = resources.getConfiguration(); if (configuration != null && configuration.fontScale != 1.0f) { configuration.fontScale = 1.0f;//这里只设置字体,故不使用下面注释的方法 // configuration.setToDefaults(); resources.updateConfiguration(configuration, resources.getDisplayMetrics()); } } return resources; }
@Override public Resources getResources() { Resources resources = super.getResources(); if (resources != null) { Configuration configuration = resources.getConfiguration(); if (configuration != null && configuration.fontScale != 1.0f) { configuration.fontScale = 1.0f;//这里只设置字体,故不使用下面注释的方法 // configuration.setToDefaults(); resources.updateConfiguration(configuration, resources.getDisplayMetrics()); } } return resources; }
The text was updated successfully, but these errors were encountered:
override fun getResources(): Resources? { if (ThreadPoolUtils.isMainThread()) { AutoSizeCompat.autoConvertDensityOfGlobal(super.getResources()) //如果没有自定义需求用这个方法 } return super.getResources() }
Duplicate of #13 里面提到了
Sorry, something went wrong.
// App 内的字体大小不跟随系统设置中字体大小的改变 AutoSizeConfig.getInstance().setExcludeFontScale(true);
AutoSizeConfig.getInstance().setExcludeFontScale(true);
No branches or pull requests
用这个方法没用,updateConfiguration也过时了
@Override public Resources getResources() { Resources resources = super.getResources(); if (resources != null) { Configuration configuration = resources.getConfiguration(); if (configuration != null && configuration.fontScale != 1.0f) { configuration.fontScale = 1.0f;//这里只设置字体,故不使用下面注释的方法 // configuration.setToDefaults(); resources.updateConfiguration(configuration, resources.getDisplayMetrics()); } } return resources; }
The text was updated successfully, but these errors were encountered: