Android screen adaptation

Source: Internet
Author: User

Screen resolution: 1024x600
Density:1 (160)
Folder: values-mdpi-1024x600

Screen resolution: 1024x600
density:1.5 (240)
Folder: values-hdpi-683x400 by 1024/1.5 600/1.5, need to be rounded.

Screen resolution: 800x480
Density:1 (160)
Folder: values-mdpi-800x480

Screen resolution: 800x480
density:1.5 (240)
Folder: values-hdpi-533x320 by 800/1.5 480/1.5, need to be rounded.

And so on
In general, you need to create values, VALUES-MDPI, and values-hdpi folders in case you can't find resources on a screen with no specified size.

Then use different dimens files in it, do not use the displayed numbers in layout, all the dimension definitions refer to the contents of Dimens.

This ensures that deep UI customization is possible

In the default.properties of the project, if the resolution is Split.density=false, the folder naming does not need to divide the scale
Screen resolution: 800x480
density:1.5 (240)
Folder: values-hdpi-800x480

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.