Specific Andro with http://blog.csdn.net/qfanmingyiq/article/details/53219812
As is doing a much better job of screen adaptation than Eclipse.
Some of the specific actions in the following as
Language adaptation
As in
1. In the Android work view, select Res right, project is almost no example
2. Mouse move new option in the pop-up level two menu select Android Resource Directory
3. Specific steps
4. Finish creating and adding language files String.xml
When you open Project view,
Here we create a folder and write down the text
Let's look at the String.xml under the original values.
- Phenomena and results
If you call this string "App_name" then if the phone is set to English then the string "Yankee", or "default", here can not only do the language adaptation can also give up to let his files such as theme colors and Dimens, etc.
Picture adaptation
This actually every what can be said actually you open this blog to see the detailed adaptation tutorial I'll simply say here.
drawable-mdpi:480*320px
drawable-hdpi:800*460px
drawable-xhdpi:1280*720px
drawable-xxhdpi:1920*1080px
Here I enumerate some representative resolutions
If we were to drawable-mdpi this folder as standard. Suppose we put a picture here 48x48
DRAWABLE-HDPI: Then put in 1.5 times times the picture 72*72
DRAWABLE-XHDPI: Put twice times the picture 96*96
DRAWABLE-XXHDPI: Put 3 times times the picture 144*144
Layout adaptation
Layout default
layout-1280x720
The resolution is 1280 and 720 shows the layout (if you do not write layout-land-1280x720 or layout-port-1280x712 then the screen is this layout) note that the middle "x" is a lowercase letter x, There are a number of ways to create this folder. Here's one of my examples.
- Open a layout file, such as a layout file in layout
- Open a layout file, such as a layout file in layout
- Add Write Size
Layout-land Default Horizontal screen
- Layout-port Default Vertical screen
Ditto
layout-land-1280x720
This layout is called in a resolution of 1280x720 and for a horizontal screen
Layout-sw360dp
Call this layout at a width greater than 360DP resolution
- Layout-sw360dp-land
Remember not to finish, we continue to select in the leftmost selection bar
Distance to fit Dimens
The Dimens folder is located in values. Then we create VALUES-W820DP or values-1280x720 write Dimens file in it to complete the adaptation
Here we create values-w820dp for example other analogies
Then re-create the Dimens.xml directory
Specific call distance mode: Dimens Use detailed introduction
Watch out.
- LAYOUT-SW320DP and layout-1280x720 are in effect at the same time. is called LAYOUT-SW320DP
- If the phone meets LAYOUT-SW320DP the screen is called this layout instead of layout (default) If you write a layout-sw360dp-land horizontal screen, call this other similar
- The adaptation can also add language and screen size to take effect as follows
- There is a gap between the DPI obtained in code and the actual number of DPI I found my question before I wrote this blog post.
Personal experience with some Andro in as