Support RecyclerView doesn't show anything until touched

前端 未结 9 1807
后悔当初
后悔当初 2021-02-04 23:41

I\'m using the support RecyclerView in my app, and I see the most bizarre thing. It doesn\'t display any items until I touch to scroll. Then, all of a sudden, the RecyclerView p

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 00:24

    It's most likely because you're not calling the correct notification methods of RecyclerView.Adapter. You have a much more granular interface for this than you previously had in ListAdapters. For example, in addAll() you should call notifyItemRangeInserted(oldConversationsSize, conversations.size()) instead of notifyDataSetChanged

提交回复
热议问题