How to add dividers using and DividerItemDecoration
suggest changeThe DividerItemDecoration
is a RecyclerView.ItemDecoration
that can be used as a divider between items.
DividerItemDecoration mDividerItemDecoration = new DividerItemDecoration(context,
mLayoutManager.getOrientation());
recyclerView.addItemDecoration(mDividerItemDecoration);
It supports both orientation using DividerItemDecoration.VERTICAL
and DividerItemDecoration.HORIZONTAL
.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents