Android 2.1的错误:使用RES /布局-V3,而不是RES /布局 [英] Android 2.1 bug: uses res/layout-v3 instead of res/layout

查看:123
本文介绍了Android 2.1的错误:使用RES /布局-V3,而不是RES /布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在除了一般 RES /布局文件夹我有一个 RES /布局-V3 文件夹与Android 1.5,其中有问题的向后兼容性 一些 RelativeLayout的的布局。

In addition to the general res/layout folder I have a res/layout-v3 folder for backward compatibility with Android 1.5, which has problems with some RelativeLayout layouts.

它可以完美地与所有的手机和模拟器版本进行测试,以便 远。除2.1(模拟器和Nexus One的)。他们选择显示 在Android 1.5的布局( RES /布局-V3 )而不是默认的 RES / 布局

It works perfectly with all phones and emulator versions tested so far. Except of 2.1 (emulator and Nexus One). They choose to display the Android 1.5 layout (res/layout-v3) instead of the default res/ layout.

能否其他人证实?这是一个Android操作系统的错误?如果是这样,在那里 是提交错误报告的最佳地点?

Can anyone else confirm that? Is this an Android OS bug? If so, where is the best place to submit the bug report?

感谢

更新:

上的http://developer.android.com/intl/fr/guide/practices/screens_support.html#qualifiers再次(感谢马克的提示),尤其是这部分

After reading up on http://developer.android.com/intl/fr/guide/practices/screens_support.html#qualifiers again (thanks Mark for the hint), especially this part

资源,这对于只在使用   特定的API级别或更高级别。对于   例如,如果您的应用程序   目的是在两个Android 1.5的运行   (API等级3)和Android 1.6(API   4及以上级别),你可以使用   -v4预选赛标记应排除任何资源时,你   应用程序在Android 1.5上运行   (API等级3)。

Resources that are for use only on a specific API Level or higher. For example, if your application is designed to run on both Android 1.5 (API Level 3) and Android 1.6 (API Level 4 and higher), you can use the -v4 qualifier to tag any resources that should be excluded when your application is running on Android 1.5 (API Level 3).

我改变了我的布局顺序从具有

I changed my layout order from having

  • RES /布局-V3(为Android 1.5仅 - >这是一个错误的假设,我做了)
  • RES /布局(为别的)

我的新具有配置:

  • RES /布局-V4(适用于Android 1.6及更高版本)
  • RES /布局(为别的 - >在这种情况下,这将是Android 1.5的只)

如果我理解上述文件的权利,如果我的括号中的假设是正确的这个时候它应该现在的工作。但是,结果是如下:

If I understand the above documentation right and if my assumptions in the parentheses are correct this time it should work now. However, the result is the following:

  • 在Android 1.5的使用RES /布局 - >确定
  • 的Andr​​oid 1.6是一个使用RES /布局-V4 - >确定
  • 在Android 2.0的使用RES /布局 - > 不会确定
  • 的Andr​​oid 2.1是一个使用RES /布局-V4 - >确定
  • Android 1.5 is using res/layout -> OK
  • Android 1.6 is using res/layout-v4 -> OK
  • Android 2.0 is using res/layout -> NOT OK
  • Android 2.1 is using res/layout-v4 -> OK

那么,为什么是Android 2.0的(在两个模拟器和摩托罗拉Milestone)没有选择正确的布局资源文件夹?

So why is Android 2.0 (on both Emulator and Motorola Milestone) not picking the right layout resource folder?

我和2.0.1再次测试它,然后,它似乎在那里工作。因此,这似乎是它得到了修复2.0.1在2.0中的错误

I tested it then again with 2.0.1 and it seems to work there. So that seems to be a bug in 2.0 which got fixed in 2.0.1

不过现在的怪异的事情:为了获得某种成功在2.0上运行我复制了RES /布局-V4文件夹RES /布局-V5采用这种布局资源,迫使Android 2.0的。没有工作。但后来我试图将其复制到RES /布局-V6(这应该是安卓2.0.1)就万事大吉了所有它与2.0突然。很奇怪!但是,我希望这个解决办法将有助于其他几个人在那里。

But now the weirdest thing: in order to make it somehow run on 2.0 I copied the res/layout-v4 folder to res/layout-v5 to force Android 2.0 using this layout resource. Didn't work. But then I tried copying it to res/layout-v6 (which is supposed to be Android 2.0.1) and voilà all the sudden it works with 2.0. Very strange! But I hope this workaround will help a few other people out there.

推荐答案

我已经测试了几个设备和仿真器(虽然不是很透),它似乎是选定的资源文件夹是一个与更高版本< =设备版本

I've tested several devices and emulators (although not very thoroughly), and it seems that the selected resource folder is the one with the higher version <= device version.

这篇关于Android 2.1的错误:使用RES /布局-V3,而不是RES /布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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