Android : App support for multiple tablet screen resolutions

社会主义新天地 提交于 2019-11-26 19:31:17

问题


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. Since I came acrosss diffrent screen resolutions for Android Tablets. For example:

  • Samsung Galaxy Tab 10.1 3G - 10.1 inches, 1280 x 800 pixels
  • Samsung P1000 Galaxy Tab - 7.0 inches, 600 x 1024 pixels
  • Dell Streak 7 - 7-inch 800×480
  • Motorola Xoom - 10.1-inch, 1280×800
  • Viewsonic G - 10.1-inchs 1024×600

For small, medium, large .. screens Android provides specific layout and drawable folders. For tablets xhdpi and xlarge has been introduces. But still my question is how to make the design reliably compatible for all different tablet screen resolutions.

Look forward to your views/suggestions.

Thanks.


回答1:


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



来源:https://stackoverflow.com/questions/5633792/android-app-support-for-multiple-tablet-screen-resolutions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!