Android design for each screen size and resolution (i)

Source: Internet
Author: User

One, resolution Independent

1. Using DP (DPI)

Android uses density-independent pixels (DP) to specify the screen size, which allows zooming to achieve the same effect on devices with different pixel densities and the same screen size. (No problem with different screen sizes yet?) )

2. Resource qualifier for pixel density

When using drawable resources that are not well-scaled dynamically, you should create and include image resources that are optimized for each pixel density category. Is drawable-hdpi, M, L feel this is the trouble .... Hey, I just use a hdpi lazy, but so small screen also loaded large pictures ...


Second, to provide support and optimization for different screen sizes

It is not necessary or worthwhile to create a different absolute layout for each specific screen configuration. Instead, it is best to use the two-segment approach:

1. Ensure that all layouts are scaled within a reasonable range.

This means try not to use the width of how much, what width=80dp. and try to use it like wrap_content ... This is a pain in the egg, our product design looked at me with the wrap_content button, said too big. A little bit more. I had to use an exact number. I don't know what a good way we can do that.

2. Create an alternate layout of a set of overlapping devices to meet all possible screen configurations.

3. Specify the supported screens in the supports-sreens element of the Mainfest file.

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.