Support RecyclerView doesn't show anything until touched

前端 未结 9 1799
后悔当初
后悔当初 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:28

    In my case it's only happen on Android 6. above this version I didn't had any problems. So what I've found to work is to use recyclerView.scrollBy(0, 0). Check it maybe it will work for you too.

    0 讨论(0)
  • 2021-02-05 00:39

    In my case only this worked:

    recyclerView.smoothScrollToPosition(arrayModel.size-1); // I am passing last position here you can pass any existing position
    

    RecyclerView was showing data only when I scroll it. So instead of user to manually scroll I have added above line which will scroll the recyclerView programmatically .

    0 讨论(0)
  • 2021-02-05 00:45

    i'm also suffering from same issue for 2 days now its done after add this line.

    adapter.notifyDataSetChanged() //after notify adapter add this one mRecyclerView.smoothScrollToPosition(list.size-1)

    0 讨论(0)
提交回复
热议问题