From what I understand, early in the preview stage there seemed to be no way to set elevation in XML only on CardView
s without a hack in Java. Now that the offi
You have to use the cardElevation attribute.
Androidx libraries:
You can use the MaterialCard included in the official Material Components library:
implementation 'com.google.android.material:material:1.x.x'
And in your layout:
Or the CardView
in the androidx packages:
implementation 'androidx.cardview:cardview:1.x.x'
And in your layout:
OLD support library: