setRecycledViewPool method in RecyclerView

前端 未结 4 1390
陌清茗
陌清茗 2020-12-16 21:50

I am trying to understand what the setRecycledViewPool method actually does along with the RecyclerView in the following line of code where mrecyclerView is a R

4条回答
  •  天涯浪人
    2020-12-16 22:20

    I haven't used it myself, but from what I can understand reading the docs its a way to use views you recycle in one RecyclerView with another.

    So if you have a RecyclerView with a bunch of decked out CardViews, and you would like to recycle those same views for another RecyclerView you could pass it a shared RecycledViewPool. Now both RecyclerView will take from the shared view pool.

提交回复
热议问题