以下是我的目录结构,使我的问题更容易理解。
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
加载。
这里有什么问题?它是特定于设备的问题吗?
答案 0 :(得分:0)
请检查应用程序失败的设备的操作系统版本,它应该是> = 3.2,因为资源名称限定符(sw720等)支持相同及以上。
尝试使用a.xml和b.xml文件添加layout-large和layout-xlarge文件夹。
检查此网址http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch