资源限定符应如何响应?

时间:2013-03-07 06:50:59

标签: android android-layout android-resources

以下是我的目录结构,使我的问题更容易理解。

res/
  layout/
    a.xml
    b.xml
  layout-land/
    a.xml
    b.xml
  layout-sw600dp-land/
    a.xml
  layout-sw720dp-land/
    a.xml

现在根据我的理解,如果设备符合layout-sw720p-land限定符并尝试访问b.xml,那么这将是订单layout-sw720p-land - > layout-land - > layout当Dalvik尝试加载b.xml时,它会在layout-land文件夹中找到该资源,永远不会转到layout文件夹加载b.xml

这对我和我一起使用的设备工作正常。但是我在Google Play上收到很多崩溃报告,但这并没有发生。如果设备未在layout-sw720p-land中找到资源,则会转到layout文件夹并加载b.xml,而不是从layout-land.xml加载。

这里有什么问题?它是特定于设备的问题吗?

1 个答案:

答案 0 :(得分:0)

请检查应用程序失败的设备的操作系统版本,它应该是> = 3.2,因为资源名称限定符(sw720等)支持相同及以上。

尝试使用a.xml和b.xml文件添加layout-large和layout-xlarge文件夹。

检查此网址http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

相关问题