RecyclerView does not Recycling Views when use it inside NestedScrollView

前端 未结 2 1961
一生所求
一生所求 2020-12-08 01:49

I\'m using RecyclerView inside NestedScrollView. Also i set setNestedScrollingEnabled to false for recyclerview

<

2条回答
  •  既然无缘
    2020-12-08 02:38

    This is because we have a recycler view which has scroll behaviour inside a scroll view. (scroll inside a scroll)

    I think the best way to resolve this issue is to your profileCardview as a header in your recycler view and then remove the nested scroll view.

    If it were a listview then it was as simple as listView.addHeaderView(profileCardView) but for the Recycler view there is no addheadview equivalent. Hence you could refer the below link to change your implementation.

    Is there an addHeaderView equivalent for RecyclerView?

提交回复
热议问题