Android Screen Adaptation course notes

Source: Internet
Author: User

1 Toggle Screen:
The file name is the same. Directory is different.
layout-port/Stands for vertical screen
layout-land/Representative Horizontal screen
The layout/represents the layout directory regardless of what has no modifiers.


Finally the realization of the product solution:
Two sets of same name, single directory different layouts.




2 when the screen switch:
The code needs to infer the direction.


Due to the use of different layout.xml
Therefore, a code check is required.






3 for the size of the setting. Suggested uses:


Layout + style + dimension form


Layout screen


Style to set the dimensions cannot describe the comfort G:march_parent


Dimension to define a fixed size




4 Screen Adaptation principles:


What about 1 Jin ke linerlayout relativelayout
The properties of the layout in. Weapons are aligned using Margin_parent, warp_conent, margin or relationlayout project layouts.




2 Assume that you cannot use a comfortable size and use the DP attribute as much as possible.




5 SW screen never spins just focus on the shortest side!




1 large screens and small screens
The width is adapted in a values-w<xxx>dp manner.
A high degree of adaptation by means of a values-h<xxx>dp.
Suitable for the shortest side length by means of a VALUES-SW<XXX>DP




2 when SW<XXX>DP and H<XXX>DP all match,
Choose the resources of SW<XXX>DP.



Android Screen Adaptation course notes

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.