XLARGE VS sw720dp屏幕尺寸混乱 [英] xlarge vs sw720dp screen size confusion

查看:169
本文介绍了XLARGE VS sw720dp屏幕尺寸混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关参考:<一href="http://developer.android.com/guide/practices/screens_support.html">http://developer.android.com/guide/practices/screens_support.html

老式的大小量词是德precated:

The old style size quantifiers are "deprecated":

的一组四个广义的大小:小,正常,大和XLARGE   注:与Android 3.2开始(API级别13),这些尺寸组是   pcated有利于新技术的管理屏幕尺寸去$ P $为主   可用的屏幕宽度。如果您正在开发Android版3.2   和更大的,看到声明平板电脑布局为Android 3.2以上   信息。

A set of four generalized sizes: small, normal, large, and xlarge Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.

我希望用3.2+设备仍然会用在绘制-大MDPI,或布局XLARGE宣布的资源,但是这似乎并不如此。

I was hoping that devices with 3.2+ would still use resources declared in drawable-large-mdpi, or layout-xlarge, but this doesn't seem to be the case.

我有一个测试项目,其中包含一个布局文件为每一个尺寸的:

I have a test project that contains a layout file for each of these sizes:

  • 布局sw600dp
  • 布局720dp
  • 布局XLARGE
  • 布局

在一个10摩托罗拉XOOM运行Android 4.0.x的,设备挑选的布局720dp文件夹中的布局。如果该文件夹不存在,它都会在布局sw600dp文件夹的布局!为什么没有它挑布局XLARGE布局?

On a 10" Motorola XOOM running Android 4.0.x, the device picks the layout in the layout-720dp folder. If that folder doesn't exist, it picks the layout in the layout-sw600dp folder! Why doesn't it pick the layout in layout-xlarge?

更奇怪的是我在这些文件夹可绘制:

Even more strange, is I have drawables in these folders:

  • 绘制-sw600dp-MDPI
  • 绘制-XLARGE-MDPI

10摩托罗拉XOOM上面,采用主从绘制-sw600dp-MDPI的形象。为什么它不挑绘制在绘制-XLARGE-MDPI?

The 10" Motorola XOOM from above, picks the image from drawable-sw600dp-mdpi. Why doesn't it pick the drawable in drawable-xlarge-mdpi?

难道我们不应该指望XLARGE量词工作在上述所有的Andr​​oid 3.2?

Should we not expect the xlarge quantifier to work at all above Android 3.2?

这是否意味着我必须复制所有资产的绘制,XLARGE-MDPI文件夹,进入绘制-sw720dp-MDPI文件夹? (支持Android 3.0,3.1和3.2 +?)

Does this mean I have to duplicate all assets in the drawable-xlarge-mdpi folder, into the drawable-sw720dp-mdpi folder? (To support Android 3.0, 3.1 AND 3.2+?)

我希望我只是在这里失踪简单的东西。请指教。

Hopefully I am just missing something simple here. Please advise.

推荐答案

从我的理解,对于Android 3.2+,如果您有至少有一个文件夹中使用新的大小量词那么它假设你正在使用这些新尺寸的量词到处。因此,这就是为什么它会忽略布局XLARGE或使用旧的量词。任何其他文件夹的原因

From my understanding, for Android 3.2+, if you have at least one folder that uses the new size quantifiers then it assumes that you are using these new size quantifiers everywhere. So this is the reason why it ignores layout-xlarge or any other folder that uses the old quantifiers.

对于向后兼容性,你必须在你的项目中使用两种类型的量词。旧的将被用于API&LT; 3.2和新的API> = 3.2。为避免重复,在布局,您可以使用别名。然而,对于可绘,我不知道任何解决方案,以避免重复。

With regard to backward compatibility, you'll have to use in your project both types of quantifiers. The old ones will be used for API < 3.2 and the new ones for API >= 3.2. To avoid duplication, for the layouts you can use aliases. However, for drawables, I don't know of any solution to avoid duplication.

这篇关于XLARGE VS sw720dp屏幕尺寸混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆