Reprint Please specify source: http://www.cnblogs.com/cnwutianhao/p/6713724.html
In "Settings", "Show", "Font size" We can set the system font size
The app interface font, if modified, may not achieve the desired effect, the interface layout has changed.
Unmodified effect (Test model: Nexus 5):
Normal small Super big
Effect after modification (test model: Nexus 5):
Normal small Super big
From these two sets of comparison charts, we can visually see that the modified app font size does not change with the system changes.
In fact, it is easy to implement, without having to set the "TextSize" in the layout file, simply rewrite the Getresources () method in the parent activity:
@Override Public Resources getresources () { super. getresources (); New Configuration (); Configuration.settodefaults (); Resources.updateconfiguration (Configuration, Resources.getdisplaymetrics ()); return resources; }
Follow me on Sina Weibo for more information on Android development!
Focus on technology critics, learn about technology, innovation, education and maximizing human intelligence and imagination!
App font size does not change with system changes