安卓:多种平板电脑屏幕分辨率应用程序支持

问题描述:

我只是跑在我的Galaxy Tab模拟器,那里的设计看起来心烦意乱的Andr​​oid应用程序。现在我担心的是如何让应用程序完全适合于所有的平板电脑屏幕。自从我来到acrosss为Android平板电脑不同势的屏幕分辨率。 例如:

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:

  • 三星Galaxy Tab 10.1的3G - 10.1英寸,1280×800像素
  • 三星P1000 Galaxy Tab的 - 11英寸,600×1024像素
  • 戴尔Streak 7 - 7英寸800×480
  • 在摩托罗拉Xoom - 10.1英寸,1280×800
  • 优派摹 - 10.1 Inchs产品1024×600

对于小型,中型,大型..屏幕Android提供具体的布局和绘制文件夹。 对于平板电脑xhdpi和XLARGE已经介绍。但是还是我的问题是,如何使设计为所有不同的平板电脑的屏幕分辨率确实兼容。

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.

期待您的意见/建议。

感谢。

我碰到使用新的大小预选赛支持多画面文档。

根据这一点,你可以创建一个这样的文件夹

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)

这结合在 xhdpi 文件夹应该给予更多的粒度。

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

更新

我碰到这个来为好,虽然这是关闭的话题,我认为可能是在某些情况下非常有用

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

这link有一个有用的技巧,以及关于使用 布局-V 办法

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