Margin between items in recycler view Android

Tushar Narang picture Tushar Narang · May 29, 2016 · Viewed 121.5k times · Source

Hi I am Following this tutorial:

http://www.journaldev.com/10024/android-recyclerview-and-cardview-example-tutorial

Now I am facing a weird issue the margin between each CardView item inside RecyclerView is way too much.

ISSUE

How to reduce the Margin between each item of CardView placed inside RecyclerView?

enter image description here

Answer

Maher Nabil picture Maher Nabil · May 29, 2016

I faced similar issue, with RelativeLayout as the root element for each row in the recyclerview.

To solve the issue, find the xml file that holds each row and make sure that the root element's height is wrap_content NOT match_parent.