RecyclerView does not Recycling Views when use it inside NestedScrollView

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

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

<

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 02:24

    For a RecyclerView or ListView the height should be constant, because if it will not a constant size then how it will manage the maximum number of visible rows in memory. Try by changing RecyclerView attribute android:layout_height="match_parent" or a fixed height(e.g. "300dp" - as needed), instead of "wrap_content". It should improve your memory management.

提交回复
热议问题