In Shanghai on business, the final test on-line, a buddy do not know how to make an old man's special font, an instant the whole interface is ugly, no way this is also a bug, find ways to solve Bai. Think about it, the phone system is set up several font size, the user is the change of heart, this we can not control. Finally found a solution, fixed dead app font is standard font, the app font will not follow the system settings change:
Add such a piece of code to the project's baseactivity (the framework of my entire project is activity adding four fragment)
/*
* fonts are not affected by system settings
* */
@Override
Public Resources getresources () {
Resources res = super.getresources ();
Configuration config = new configuration ();
Config.settodefaults ();
Res.updateconfiguration (config, res.getdisplaymetrics ());
return res;
}
How to block the phone system setting up the adaptation problems caused by large size fonts (used by older people)