带水平滚动的java嵌套回收视图
我试图用3层实现嵌套的RecyclerView
。第一个RecyclerView
(父)视图设置为垂直滚动。第二个RecyclerView
(第一个视图的子视图)设置为水平滚动。第三个RecyclerView
(第二个视图的子视图)也设置为水平滚动
要可视化:
->RecyclerView
具有垂直滚动
--&燃气轮机RecyclerView
带水平滚动
---&燃气轮机RecyclerView
带水平滚动
现在,问题是我无法使第三个水平循环视图水平滚动。我认为问题在于设备正在优先处理第二个RecyclerView
的水平滚动
你能帮我解决这个问题吗
这是第一个垂直滚动布局的代码片段:
<安卓.support.v4.widget.NestedScrollView
安卓:layout_width="match_parent"
安卓:layout_height="match_parent">
<安卓.support.v7.widget.RecyclerView
安卓:layout_width="match_parent"
安卓:layout_height="wrap_content"/>
</安卓.support.v4.widget.NestedScrollView>
这是用于第二个具有水平滚动的:
<LinearLayout
安卓:layout_width="match_parent"
安卓:layout_height="wrap_content">
<安卓.support.v7.widget.RecyclerView
安卓:layout_width="match_parent"
安卓:layout_height="wrap_content"/>
</LinearLayout>
这是最后一个带有水平滚动的:
<TextView
安卓:layout_width="wrap_content"
安卓:layout_height="wrap_content"/>
我已经尝试用onIntercept...()
截取触摸,以在触摸第三个RecyclerView
时取消第二个RecyclerView
的滚动
# 1 楼答案