1. Use linear layout (linearlayout) and relative layout (relativelayout) As far as possible, do not use absolute layout.
2. Use dip and SP as far as possible, do not use PX.
3. Provide different layout files and pictures for different resolution.
For example:
4. Set up multiresolution support in Androidmainfest.xml.
Copy Code code as follows:
<supports-screens
Android:largescreens= "true"
Android:normalscreens= "true"
Android:anydensity= "true"
Android:smallscreens= "true"/>
To
sum up :
1 android:anydensity= "True", the system will automatically find the corresponding folder according to the screen density.
2) android:anydensity= "false"
(1) If there is a different density representation of the same picture resource in the drawable-hdpi,drawable-mdpi,drawable-ldpi three folders, then the system will load the resources in the DRAWABLE_MDPI folder
(2) If there are high-density images in the DRAWABLE-HPDI, the other two folders do not have corresponding picture resources, then the system will load drawable-hdpi resources.
(3) If there is a picture resource in the drawable-hdpi,drawable-mdpi, there is no corresponding picture resource in drawable-ldpi, then the system will load the resources in drawable-mdpi folder