Android: Settings app font size does not follow the system font adjustment and changes

Source: Internet
Author: User

The need to do font size within the app is similar to setting the font size in.

Then you need the app to not follow the system font size adjustment, and found two methods.

    1. Method 1: Override the GetResource () method, modify the configuration to Settodefaults ()
1     /**2 * Settings app does not change with system font adjustment3      */4 @Override5      PublicResources getresources () {6Resources Resources =Super. Getresources ();7Configuration Configuration =resources.getconfiguration ();8 configuration.settodefaults ();9         returnresources;Ten}

    1. Method 2: Use DP for font units.

The first method is currently in use.

Android: Setting app font size does not follow system font adjustments

Related Article

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.