Space Between CardView

user6730398 picture user6730398 · Aug 21, 2016 · Viewed 14k times · Source

I need to add space between CardView.

I tried to use the card_view:cardUseCompatPadding and it doesn't work. Any help?

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.CardView
        android:id="@+id/all_restaurant_card_view"
        android:layout_width="wrap_content"
        android:layout_height="120dp"

        xmlns:card_view="http://schemas.android.com/apk/res-auto"
        card_view:cardPreventCornerOverlap="true"
        card_view:cardUseCompatPadding="true">

Answer

Thorvald Olavsen picture Thorvald Olavsen · Aug 21, 2016
android:layout_marginBottom="4dp"  //4dp is recommended