For example, I recently made a device interface to adapt to different resolutions.
The implementation method is as follows:
First, you need to add sub-elements in the <manifest> element of the androidmanifest. xml file as follows:
<Supports-screens
Android: largescreens ="True"
Android: normalscreens ="True"Android: anydensity ="True"
Android: smallscreens ="True"> </Supports-screens>
As expected, the above is to set multi-resolution support for our screens (more accurately, it is to adapt to three types of density: large, medium, and small ).Android: anydensity ="True ",This sentence plays a very important role in the entire screen. The value is true. When our application is installed on mobile phones of different density, the program loads hdpi and mdpi respectively, resources in the ldpi folder.
Conversely, if the value is setFalse. Even if we have the same resource in the hdpi, mdpi, and ldpi foldersApplicationIt will not automatically go to the corresponding folder to find resources. This situation occurs on high-density and low-density mobile phones, such as a 240x320 pixel mobile phone. If you set Android: anydensity ="False ",Android system will
X 320 (low density) is converted to 320x480 (medium density). In this case,ApplicationThe resources in the mdpi file will be loaded on the cell phone with a small density.
Drawable-hdpi, drawable-mdpi, drawable-ldpi. drawable-xhdpi. drawable-large drawable-small drawable-xlarge
It is implemented by placing images of different sizes inside
Of course, layout-hdpi Layout-large... is also used for layout.
Example: http://download.csdn.net/detail/penglijiang/4952093