Scolling with multiple RecyclerViews in Layout

前端 未结 2 619
后悔当初
后悔当初 2020-12-14 13:13

I have created a layout which has two RecyclerViews. One scrolls horizontally while other scrolls vertically. I can scroll correctly inside each RecyclerView but the page as

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 13:50

    RecyclerView only gained (still limited) support for nested scrolling in version 22.2.0 - my first suggestion would be to try that.

    The only view that fully supports nested scrolling is NestedScrollView (you can see this by noting that it implements both NestedScrollingChild and NestedScrollingParent) and was added in Support v4 version 22.1.0 (slightly improved in 22.2.0). If you only have a single horizontal RecyclerView as the topmost item in your vertical RecyclerView, you could instead replace that with a NestedScrollView that contains a LinearLayout with your horizontal RecyclerView followed by your vertical RecyclerView.

提交回复
热议问题