Personal experience with some Andro in as

Source: Internet
Author: User

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.

    1. 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

    1. Layout default

    2. 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.

      1. Open a layout file, such as a layout file in layout
      2. Open a layout file, such as a layout file in layout
      3. Add Write Size
    3. Layout-land Default Horizontal screen


    4. Layout-port Default Vertical screen
      Ditto
    5. layout-land-1280x720

      This layout is called in a resolution of 1280x720 and for a horizontal screen


    6. Layout-sw360dp

      Call this layout at a width greater than 360DP resolution


    7. 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.
    1. LAYOUT-SW320DP and layout-1280x720 are in effect at the same time. is called LAYOUT-SW320DP
    2. 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
    3. The adaptation can also add language and screen size to take effect as follows
    4. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.