How can a divider line be added in an Android RecyclerView?

The Solution to How can a divider line be added in an Android RecyclerView? is


In the October 2016 update, the support library v25.0.0 now has a default implementation of basic horizontal and vertical dividers available!

https://developer.android.com/reference/android/support/v7/widget/DividerItemDecoration.html

 recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL));

~ Answered on 2016-10-24 11:55:23


Most Viewed Questions: