【发布时间】:2017-01-18 12:14:19
【问题描述】:
我目前正在尝试将 Android 移动应用程序移植到 Android TV。我有一个似乎在我的 Android TV 应用程序中正确显示的 RecyclerView。但我似乎无法使用 dpad 控件在 RecyclerView 内导航。 P.S 我已经尝试过以下线路。找不到其他任何东西
android:descendantFocusability="afterDescendants"
还建议对电视应用使用回收站视图吗?
我还阅读了 developer.android.com 上 TV 应用程序的完整架构,并查看了他们的示例项目,但发现 recycler view 无处可去。
【问题讨论】:
-
使 recyclerview 元素具有焦点
-
我添加了这一行 android:descendantFocusability="afterDescendants" not working
-
回收视图的children必须是可聚焦的。
-
还添加了 android:focusable="true" 到 recylerview 项目。没有运气
-
如果您能提供您的问题领域的代码示例会有所帮助
标签: android android-recyclerview android-tv leanback d-pad