Reference: http://blog.csdn.net/zhaokaiqiang1992/article/details/45419023
The following principles are supported for various screen sizes:
Use Wrap_content,match_parent,weight (try to avoid the size of the control to die, such as 40DP)
Use relative layout to disable Absolute layout additions: (linear layout for situations with a proportional relationship, use with weigh)
Using qualifiers
Using auto-stretch bitmaps
Weight:
Calculated width = width of original width + percentage of remaining space
For example L: Screen width l
button1:2/3l = L + (l-2l) *1/3
button2:1/3l = L + (l-2l) *2/3
button1:1/3l = 0+ 1/3l
BUTTON2:2/3 = 0 + 2/3l
Use minimum width qualifier: android3.0 after support LAYOUT-SW600DP (sw:small width)
Do not differentiate whether the horizontal screen: As long as the width is greater than 600DP will default to load the corresponding layout of the folder
Normal Mobile: Layout/main.xml
Tablet: layout-sw600dp/main.xml (Create a new folder with the layout level under res named Layout-large a layout file with the same name under the folder is selected to load the layout file under different folders depending on the size of the hardware)
Screen Orientation qualifier:
Layout-land
Layout-port
.9 Figure
The point on the left and top points is the stretched point
Left point: Stretches the point horizontally across the area (the horizontal line where the point is) when stretched up and down
Top point: Stretches the point vertically across the area (the vertical bar where the point is) when stretched left and right
The area selected on the right and bottom can be modified padding
1. Icon:
2. Fonts
Settings must be even, odd numbers can cause pixel loss when zooming in:
Android screen Adaptation