Setting Elevation in XML on AppCompat CardView on Android 5.0
It looks like a margin/padding problem, try to set the cardUseCompatPadding attribute to true. E.g.: <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=”match_parent” android:layout_height=”match_parent” android:layout_margin=”6dp” card_view:cardUseCompatPadding=”true” card_view:cardElevation=”4dp” card_view:cardCornerRadius=”3dp”> Explanation from Android doc : CardView adds additional padding to draw shadows on platforms before L. This may cause Cards to have different sizes between L and before L. If you … Read more