Android UI Design: Supporting Multiple Screens

后端 未结 6 1262
鱼传尺愫
鱼传尺愫 2020-11-30 01:19

I have read this tutorial SUPPORTING MULTIPLE SCREENS several times and many stackoverflow questions regarding Design Android UIs to fit well with all android screen s

相关标签:
6条回答
  • 2020-11-30 01:46

    If it is very important to specify to that extreme, there is a handy tool for folder naming, and that is chaining. Ex. layout-w480dp-normal and that would be screen sizes at least 480dp in width, and fall under the normal category. Note: I didn't get the need to develop for such detailed requirements, but according to the linked source, it should work just fine.

    Source

    Make sure to follow these rules

    0 讨论(0)
  • 2020-11-30 01:49

    Create different layouts for different screen.

    res/layout-large/

    res/layout-sw600dp/

    ldpi (low) ~120dpi
    mdpi (medium) ~160dpi
    hdpi (high) ~240dpi
    xhdpi (extra-high) ~320dpi
    xxhdpi (extra-extra-high) ~480dpi
    xxxhdpi (extra-extra-extra-high) ~640dpi
    

    Find android UI design examples and tutorials: http://www.viralandroid.com/2015/11/android-user-interface-ui-design-tutorial.html

    0 讨论(0)
  • 2020-11-30 02:02

    Generalized densities.

    A set of six generalized densities:
    ldpi (low) ~120dpi
    mdpi (medium) ~160dpi
    hdpi (high) ~240dpi
    xhdpi (extra-high) ~320dpi
    xxhdpi (extra-extra-high) ~480dpi
    xxxhdpi (extra-extra-extra-high) ~640dpi
    

    Just Define folder for different image like:

    drawable-large-xhdpi: copy (drawable-xxhdpi images)
    drawable-xlarge-xhdpi: copy (drawable-xxxhdpi images)
    drawable-xxhdpi: 1080x1920 slicing
    drawable-xxxhdpi : 1440x25601 slicing
    

    Add support multiple screen size support in manifest.

     <supports-screens
            android:anyDensity="true"
            android:largeScreens="true"
            android:normalScreens="true"
            android:resizeable="true"
            android:smallScreens="true"
            android:xlargeScreens="true" />
    

    0 讨论(0)
  • 2020-11-30 02:08

    You can use the following resource folders to create layouts for devices with larger screens :

    7 inch tablets
    res\layout-sw600dp

    10 inch tablets
    res\layout-sw720dp

    0 讨论(0)
  • 2020-11-30 02:09

    Instead of using the dp size unit you can use the sdp size unit that is relative to the screen size.

    Using the sdp size unit you will have the same user experience on all screen sizes with only one layout xml.

    Use it carefully! for example, in most cases you still need to design a different layout for tablets.

    For text view sizes please refer to the ssp size unit (based on the sp size unit)

    0 讨论(0)
  • 2020-11-30 02:10

    For Multiple screen support:

    1. Mobile : Create different values folder which is mention below:

    values                     (For mdpi devices)
    values-hdpi                (For hdpi devices)
    values-xhdpi               (For xhdpi devices)
    values-xxhdpi              (For xxhdpi devices)
    

    1. Tablets: Create different layout folder which is mention below:

    layout-sw600dp             (For 7″ to 9″ Screen)
    layout-sw720dp             (For 10″ to above screen)
    

    For image resources: Create 4 drawable folders:

    drawable-mdpi
    drawable-hdpi
    drawable-xhdpi
    drawable-xxhdpi
    

    0 讨论(0)
提交回复
热议问题