How to block the phone system setting up the adaptation problems caused by large size fonts (used by older people)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.