Add Items to top of recyclerview

后端 未结 9 2076
臣服心动
臣服心动 2021-01-04 04:56

I have a Recyclerview in my activity. when I pull down it will load new items to recycle view. Now I need to implement pull to refresh the concept to my recyclerview. I have

相关标签:
9条回答
  • 2021-01-04 05:39

    Add following line when you set your recyclerview

    recyclerView.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,true));
    
    0 讨论(0)
  • 2021-01-04 05:40

    in Recyclerview you also set your list order. you just set your adapter to reverse true or false.

    RecyclerView.LayoutManager layoutManager=newLinearLayoutManager(this,LinearLayoutManager.VERTICAL,true);
    recyclerView.setLayoutManager(layoutManager);
    

    after set layout manager to your Recyclerview Adapter. And if you want to perform delete some item view on your recyclerview also you need to add

    layoutManager.setStackFromEnd(true);
    
    0 讨论(0)
  • 2021-01-04 05:42

    use list.add(0,items); it will add new item to top of recyclerview

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