Android : App support for multiple tablet screen resolutions

前端 未结 1 1329
广开言路
广开言路 2020-12-04 23:01

I just ran my Android application on Galaxy Tab Emulator, where the design looks distracted. Now my worry is how to make the app fit perfectly on all the Tablet Screens. Sin

1条回答
  •  失恋的感觉
    2020-12-04 23:24

    I came across Using new size qualifiers in the Supporting Multiple Screens documentation.

    According to this you can create folders like this

    res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
    res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)
    res/layout-sw720dp/main_activity.xml   # For 10” tablets (720dp wide and bigger)
    

    this in combination with the xhdpi folder should give more granularity.

    UPDATE

    i came across this as well, though this is off the topic I think might be useful in some cases

    res/layout/mylayout.xml       # Default layouts
    res/layout-v4/mylayout.xml    # Android 1.6 layouts
    res/layout-v11/mylayout.xml   # Android 3.0 layouts
    

    this link has a useful tip as well regarding using layout-v approach

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