Android multi-screen adaptation

Source: Internet
Author: User

For multi-screen adaptation in Android, you can place layout files in the layout_hdpi/layout_mdip/layout_ldpi/layout directory.

If a big screen mobile phone is adapted, the adaptation sequence is layout_hdpi-> layout_mdpi-> Layout-> layout_ldpi;

If an on-screen mobile phone is applicable, the adaptation sequence is layout_mdpi-> Layout-> layout_hdpi-> layout_ldpi;

If the mobile phone of a small screen is adapted, the adaptation sequence is layout_ldpi-> Layout-> layout_mdpi-> layout_hdpi;

Assume that the default layout file of an application is placed in the layout directory. If some interfaces have problems with adaptation to the mobile phone on the screen, the layout file is customized separately and placed in the layout_ldpi directory.

Is there a problem? From the above adaptation sequence, when this interface is displayed on a big screen mobile phone, the order for searching layout files is layout_hdpi-> layout_mdpi-> Layout-> layout_ldpi, you can see that the layout file of the screen is in layout_mdpi, not layout.

Recommended Practices:

1. By default, layout files are placed in layout_mdpi, while no files are placed in layout;

2. the default layout file is placed in layout. However, if you have customized the layout file for the special screen, you can add one copy of the layout file to the layout_hdpi/layout_mdpi/layout_ldpi directories;

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.