Google TV 上有不同的布局吗?
我正在将专为 Honeycomb 平板电脑制作的应用程序转换为 Google TV 应用程序。我的主要布局称为 main.xml。它位于布局文件夹中。我创建了一个新文件夹layout-notouch,其中包含新的main.xml,以便在应用程序在Google TV上运行时显示。但是当我运行我的应用程序(在 Google TV Android SDK Addon 上)时,他仍然使用正常布局文件夹中的 main.xml,而不是布局-notouch 中的 main.xml。我在这里做错了什么?
更新:我发现layout-notouch不起作用。当我以大布局播放文件时,它可以工作。但这不是我想要的。我应该向 Google 发送有关此问题的错误报告吗?
更新:我在 Google Code 上的 Android 项目中输入了错误报告。您可以在 https://code.google.com/p/ 找到它android/issues/detail?id=20087
I'm converting a app made for Honeycomb tablets into a Google TV app. My main layout is called main.xml. It's in the layout folder. I created a new folder layout-notouch with a new main.xml to display when the app is run on Google TV. But when I run my app (on the Google TV Android SDK Addon) he is still using the main.xml from the normal layout folder and not from the layout-notouch. What am I doing wrong here?
Update: I figured out that the layout-notouch is not working. When I play the file in layout-large, it working. But this is not what I want. Should I send a bug report to Google about this?
Update: I entered a bugreport into the Android Project on Google Code. You can find it at https://code.google.com/p/android/issues/detail?id=20087
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们建议您的资源限定符为layout-tvdpi-notouch (720) & layout-xhdpi-notouch (1080)
layout-large-notouch 也应该可以工作。
We are suggesting that your resource qualifiers be layout-tvdpi-notouch (720) & layout-xhdpi-notouch (1080)
layout-large-notouch should also work.
根据 Google 的其他人的说法,有一个
television
资源选择器,它是在 Android 3.2 中引入的:https://plus.google.com/u/0/108284392618554783657/posts/Lf5g8nqw6s4文档还没有更新,但想必这就是
Configuration 中对应的常量:https://developer.android.com/reference/android/content/res /Configuration.html#UI_MODE_TYPE_TELEVISION
According to someone else at Google, there is a
television
resource selector, which was introduced with Android 3.2: https://plus.google.com/u/0/108284392618554783657/posts/Lf5g8nqw6s4The documentation still hasn't been updated, but presumably this is the corresponding constant in
Configuration
: https://developer.android.com/reference/android/content/res/Configuration.html#UI_MODE_TYPE_TELEVISION