CardView not showing shadow elevation

If your manifest file has a android:hardwareAccelerated="false" line, delete it.


<android.support.v7.widget.CardView android:id="@+id/item_card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    app:cardCornerRadius="2dp"
    app:cardUseCompatPadding="true"
    app:cardElevation="2dp"
    app:cardBackgroundColor="@color/md_white_1000"
    android:foreground="?android:attr/selectableItemBackground"
    android:clickable="true">

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

app:cardUseCompatPadding="true" is the main catch here


Do not forget that to draw shadow you must use hardwareAccelerated drawing

<application android:hardwareAccelerated="true" ...>

see for details https://developer.android.com/guide/topics/graphics/hardware-accel.html?hl=ru