I am using CardView inside a RecyclerView. After reading a lot I ended up with following \'NOT WORKING\' code only on Android 5.1.1. On Android Version prior to this one its
Just simply add this code to your Card View in xml file!
card_view:cardUseCompatPadding="true"
You have to import card_view with Alt+Enter ! And code below will be import in top !.
xmlns:card_view="http://schemas.android.com/apk/res-auto"
You'll see elevation is working on android 5 or 5+ .