Implement multiple ViewHolder types in RecycleView adapter

后端 未结 9 1697
迷失自我
迷失自我 2020-12-13 16:34

It\'s maybe a discussion not a question.

Normal way to implement multiple types

As you know, if we want to implement multiple types in RecyclerView

9条回答
  •  半阙折子戏
    2020-12-13 17:04

    Second one is buggy because when ViewHolders get recycled it produces unexpected behavior. I considered changing visibility during binding but it isn't performant enough for large amount of Views. Recycler inside RecyclerView stores ViewHolders per type so first way is more performant.

提交回复
热议问题