Write a conclusion first
Layout adaptation:
1, do not use the relative layout, try to use the percentage layout
2. Use match_parent as much as possible
3, can use the heavy place as far as possible to use the weight (android:layout_weight)
4, if it is a solid color background, try to use the shape of Android to customize
5. If you need to fit at a specific resolution, you can create a new Layout-hxw.xml folder on the Res directory. For example, to fit a 1080*1800 screen, create a new Layout-1800x1080.xml folder
Picture adaptation:
1, as far as possible to use 9 sister map
2, important pictures or smaller icons, according to the proportion of 3:4:6:8:12 design 5 sets, not important picture design set, based on 720 placed in xhdpi, based on 1080 placed in xxhdpi
Five picture folders corresponding density and general resolution
The actual zoom ratio of the picture (although visually the same)
The steps for the Android system to look for pictures are this:
1, go to the screen density corresponding to the directory to find. If you find it, take it.
2, if not found, go to a higher density than the directory inside to find, if found to use.
3, if not found, continue to look up. And so on
4, if the XXHDPI directory has not been found, it will go to the lower level than its own screen density of the directory to find, if the low level of the directory >=hdpi, found the use.
5, if not found, go to mdpi directory to find, if found, take it.
6, if not found, go to the default drawble directory to find, if found, take it.
7, if not found, then go to the lowest ldpi directory to find. If you find it, take it.
8, if not found, it is not found, the picture can not be displayed. (This is usually not the case, because if you don't have this picture in every directory, you're not compiling it.)
Android Screen Adapter