Android has been widely sought after since its launch. Due to its open features, the market has emerged immediately. Different Versions of Android machines, different Android OS, and different OEMs, of course there will be a lot of inexplicable screen sizes. for this reason, I introduced in my previous article how to get the width and height of the Android mobile phone through encoding. With this width and height, we can implement Android adaptive screen size.
The method is actually very simple. The most common is to create a layout folder of the corresponding size under res.
For example:
The screen size of the HTC Sensation Z710e mobile phone is 540x960 pixels. For details about the 4.3 inches parameters, refer to: large,
Folder name format: layout-screen direction (port portrait screen/land landscape screen)-screen height (pixels)-screen width (pixels ),
Legend:
Create the corresponding layout file in the layout-port-960x540 folder and use the app's phone if the screen size is 540x960 pixels, the system will automatically use the layout file under the layout-port-960x540 folder for page layout. further, we can infer that we can adapt to N kinds of screens.
There are many similar introductions on the Internet. We recommend the following:
Http://www.cnblogs.com/leon19870907/archive/2012/02/01/2335143.html