One, resolution Independent
1. Using DP (DPI)
Android uses density-independent pixels (DP) to specify the screen size, which allows zooming to achieve the same effect on devices with different pixel densities and the same screen size. (No problem with different screen sizes yet?) )
2. Resource qualifier for pixel density
When using drawable resources that are not well-scaled dynamically, you should create and include image resources that are optimized for each pixel density category. Is drawable-hdpi, M, L feel this is the trouble .... Hey, I just use a hdpi lazy, but so small screen also loaded large pictures ...
Second, to provide support and optimization for different screen sizes
It is not necessary or worthwhile to create a different absolute layout for each specific screen configuration. Instead, it is best to use the two-segment approach:
1. Ensure that all layouts are scaled within a reasonable range.
This means try not to use the width of how much, what width=80dp. and try to use it like wrap_content ... This is a pain in the egg, our product design looked at me with the wrap_content button, said too big. A little bit more. I had to use an exact number. I don't know what a good way we can do that.
2. Create an alternate layout of a set of overlapping devices to meet all possible screen configurations.
3. Specify the supported screens in the supports-sreens element of the Mainfest file.