Android Screen Adaptation summary

Source: Internet
Author: User

Android Development, open source, full market is a messy model, there is always a suitable for such or that model. Share some of the methods you use in your development here.

First of all to introduce drawable-mdpi, drawable-hdpi-1280x800, drawable-hdpi. This is believed to have a good look and understand. Represents the resolution 320X480, 1280x800, 480x800 three screen picture resource pack. In fact, there are a lot of adaptation. I roughly say one on the line, other people slowly pondering, or the internet turnover.

Explain the meaning of this figure, that is, I want to say the configuration method, is a set of picture resources (resource files to see the design of art. Preferably a xxx.9.png) with a set of layout files and multiple sets of numerical files.

Layout file:

[HTML]View Plaincopyprint?
  1. <? XML version= "1.0" encoding="Utf-8"?>
  2. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="fill_parent"
  5. android:orientation="vertical" >
  6. <ImageView
  7. android:layout_width="@dimen/imagewidth"
  8. android:layout_height="wrap_content"
  9. android:background="@drawable/ic_launcher" />
  10. </linearlayout>

Value file:

[HTML]View Plaincopyprint?
  1. <? XML version= "1.0" encoding="Utf-8"?>
  2. <resources>
  3. <!--values-hdpi 480X800 --
  4. <dimen name="ImageWidth">120dip</dimen>
  5. </Resources>

[HTML]View Plaincopyprint?
    1. <resources>
    2. <!--values-hdpi-1280x800 --
    3. <dimen name="ImageWidth">220dip</dimen>
    4. </Resources>

[HTML]View Plaincopyprint?
      1. <? XML version= "1.0" encoding="Utf-8"?>
      2. <resources>
      3. <!--values-hdpi 480X320 --
      4. <dimen name="ImageWidth">80

Android Screen Adaptation summary

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.