简体   繁体   English

Android:App支持多种平板电脑屏幕分辨率

[英]Android : App support for multiple tablet screen resolutions

I just ran my Android application on Galaxy Tab Emulator, where the design looks distracted. 我刚刚在Galaxy Tab Emulator上运行我的Android应用程序,设计看起来分散了注意力。 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. 因为我为Android平板电脑提供了不同的屏幕分辨率。 For example: 例如:

  • Samsung Galaxy Tab 10.1 3G - 10.1 inches, 1280 x 800 pixels 三星Galaxy Tab 10.1 3G - 10.1英寸,1280 x 800像素
  • Samsung P1000 Galaxy Tab - 7.0 inches, 600 x 1024 pixels 三星P1000 Galaxy Tab - 7.0英寸,600 x 1024像素
  • Dell Streak 7 - 7-inch 800×480 戴尔Streak 7 - 7英寸800×480
  • Motorola Xoom - 10.1-inch, 1280×800 摩托罗拉Xoom - 10.1英寸,1280×800
  • Viewsonic G - 10.1-inchs 1024×600 Viewsonic G - 10.1英寸1024×600

For small, medium, large .. screens Android provides specific layout and drawable folders. 对于小型,中型,大型屏幕,Android提供特定的布局和可绘制的文件夹。 For tablets xhdpi and xlarge has been introduces. 对于平板电脑,xhdpi和xlarge已经推出。 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. 谢谢。

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. 这与xhdpi文件夹结合使用可以提供更多的粒度。

UPDATE 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 关于使用layout-v方法,此链接也有一个有用的提示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM