我正在尝试RecyclerView
用 3 层实现嵌套的 s。第一个RecyclerView
(父)视图设置为垂直滚动。第二个RecyclerView
(第一个的子)视图设置为水平滚动。第三个RecyclerView
(第二个的子)视图也设置为水平滚动。
可视化:
->RecyclerView
垂直滚动
-->RecyclerView
水平滚动
--->RecyclerView
水平滚动
现在,问题是我不能让第三个水平 RecyclerView 水平滚动。我认为问题是设备优先考虑 2nd 的水平滚动RecyclerView
。
你能帮我解决这个问题吗?
这是第一个垂直滚动布局的代码片段:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v4.widget.NestedScrollView>
这是第二个水平滚动的:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
这是最后一个水平滚动的:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
我已经尝试在第三个被触摸时拦截触摸onIntercept...()
以取消第二个的滚动。RecyclerView