Why RecyclerView.notifyItemChanged() will create a new ViewHolder and use both the old ViewHolder and new one?

后端 未结 6 563
半阙折子戏
半阙折子戏 2020-12-18 17:57

Recently I use RecyclerView and add a custom header view (another type of item view) and try to updated it when data has changed. Something strange happens. The adapter crea

6条回答
  •  旧时难觅i
    2020-12-18 18:29

    ((SimpleItemAnimator) myRecyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
    

提交回复
热议问题