setRecycledViewPool method in RecyclerView

前端 未结 4 1380
陌清茗
陌清茗 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:26

    setRecycledViewPool(...) can be useful when we have a nested RecyclerView. See this blog post for details. A short description of the same link is added here.

    Consider a case where you have a nested RecyclerViews and inner RecycleViews share the same view structure. RecycledViewPool provides a seemless way to share views between these inner (nested) RecyclerViews.

    An example of such case could be seen in the following image:

    As you can see the types of views for both lists are same.

提交回复
热议问题