Recyclerview - Overlap items bottom to top

后端 未结 3 1244
鱼传尺愫
鱼传尺愫 2020-12-15 04:14

I have set the negative margin for items like this:-

ItemDecoration.java

public class ItemDecorator extends RecyclerView.ItemDecorat         


        
3条回答
  •  北海茫月
    2020-12-15 04:49

    Try this way and render your recycler view in reverse direction.

    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
            layoutManager.setReverseLayout(true);
            layoutManager.setStackFromEnd(true);
            recyclerView.setLayoutManager(layoutManager);
    

    Here is the working example GitHub Link

提交回复
热议问题