How to prevent auto scroll in RecyclerView after notifyDataSetChanged?

前端 未结 3 382
Happy的楠姐
Happy的楠姐 2021-01-14 10:31

I have a RecyclerView with several items types. It looks like this:

  • 07/21/2017
  • Message 1
  • Message 2
  • Message 3
  • 0
3条回答
  •  耶瑟儿~
    2021-01-14 11:03

    You can know where the new item has been inserted using list.indexOf(yourItem) on your list of items. Then you can call notifyItemInserted()

提交回复
热议问题