Search code examples
androidxmlandroid-layoutcardview

Showing a thin line betwen cardview items


enter image description here

As above screenshot you can see number of item cover by cardview,but question is card view contain thin between two item

How can i remove this thin line, my cardview xml property is

  <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="5dp"
        card_view:cardPreventCornerOverlap="true"
        card_view:cardElevation="10dp"
        card_view:cardBackgroundColor="@color/white"
        card_view:cardCornerRadius="4dp">

    </android.support.v7.widget.CardView>
</RelativeLayout>

Solution

  • change

    card_view:cardElevation="10dp"
    

    to this:

    card_view:cardElevation="2dp"