Skip to content Skip to sidebar Skip to footer

Divideritemdecoration Doesn't Show Up In Recyclerview

I found that DividerItemDecoration work fine with simple, one line list items, but with more complex one it refuses to show up. Here's the XML of list item:

Solution 1:

Your RecyclerView's orientation is android:orientation="horizontal", but you use DividerItemDecoration.VERTICAL_LIST. This is wrong. You should use DividerItemDecoration.HORIZONTAL. This is counter-intuitive :-)

Solution 2:

A had a similar problem but in my case it was using a RelativeLayout as the root layout of my item. Changed it to LinearLayout and it worked.

My suggestion is to simplify your item xml until you can see the divider.

Post a Comment for "Divideritemdecoration Doesn't Show Up In Recyclerview"