folder directory different resource adaptation
1, set up a folder corresponding to the screen resolution, such as a screen resolution of 540*960, you can establish the corresponding resource folder values-960x540, This will read the corresponding file information according to the resolution.
2, consider the horizontal screen and vertical screen layout effect: Android has Layout-port and layout-land two directories placed vertical screen and horizontal screen of two layout files, the mobile phone screen changes, will automatically call the corresponding layout file.
3, suitable for large screen, sometimes need to consider a tablet-like screen for adaptation, you can put the XML layout file in the Layout-large folder, the name of this folder and layout under the same arrangement, Screens that exceed 7 inches will automatically read the files under large. (Note: Before android3.2 version trial)
4, the version after android3.2 can use the LAYOUT-SW600DP folder, SW is the abbreviation of small width, see the meaning of the minimum width is known. The rules of this folder are the same as the Layout-large, which represents the width and height of the minimum side of the 600DP layout, which is more than 600DP screen.
5, layout aliases: Sometimes in the SW600DP file and large folder or multiple folders need to maintain layout files, this time we also write two copies of the code is a bit redundant, we need to set the layout alias to maintain a common set. In layout can only 2 files one is a small screen default such as: Main.xml, the other is a large screen such as: Main_large.xml. Then you configure the alias under values,
Default: Values/layout.xml
Minimum width 600dp:values/layout-sw600dp/layout.xml code is as follows
Greater than 7 inches before 3.2: The Values/layout-large/layout.xml code is as follows