Search code examples
androidandroid-recyclerviewandroid-cardview

Margin between items in recycler view Android


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


Solution

  • 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.