Android Development Screen Adaptive

Source: Internet
Author: User

Scenario one: In different dpi drawable inside each place a set of pictures, the system read the phone hardware dpi when automatically get the corresponding drawable folder inside the picture. This solution can only partially solve the problem.

Scenario two: Recommended method; Set the appropriate layout for the phone on different screens. If MX3 phone resolution is 1800*1080, then a new layout folder in the Res folder is named layout-1800x1080.

Some phones are 1280*720, then a new layout is layout-1280x720. In this case, when your test machine is a 1280x720 screen, it will read the layout inside the layout-1280x720, and when it is the 1800*1080 screen, it will load layout-1800x1080 Inside the layout.

When the test machine screen is otherwise, a bug will occur. The solution is to set up a layout folder without parameters, and when the test machine screen does not match the layouts of the exact parameters set, it will load the configuration of this non-parameter-without-parameters.

Program II has been tested, the effect is good.

Android Development Screen Adaptive

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.