Cardview – white border around card

I know it’s a bit late, but for anyone having a similar problem:

I had the same issue: A white border was shown on pre-lollipop devices.

I solved it setting the cardPreventCornerOverlap to false on your XML.

Like this:

<android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_marginRight="6dp"
    card_view:cardPreventCornerOverlap="false">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <!-- some other views -->
    </LinearLayout>
</android.support.v7.widget.CardView>

Leave a Comment

tech