CardView inherits from the Framelayout class, which allows for consistent display of content in a card layout that can contain fillets and shadows. CardView is a layout that can be used to lay out other view.
Properties of the CardView:
Elevation--cardview z-axis shadows;
Cardbackgroundcolor--cardview color of Cards;
Cardconerradius--The degree of rectangle of the four corners of the CardView card;
In the following XML file, this card control is a card that has a rectangle degree of 8DP and a black background color.
<Android.support.v7.widget.CardViewxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:app= "Http://schemas.android.com/apk/res-auto"Android:id= "@+id/cardview"App:cardcornerradius= "8DP"App:cardbackgroundcolor= "@color/black"Android:layout_margin= "8DP"Android:layout_height= "80DP"Android:layout_width= "Match_parent"> <TextViewAndroid:text= "TextView in CardView"android:layout_gravity= "Center"android:textsize= "26SP"Android:textcolor= "@color/l_white"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" /> </Android.support.v7.widget.CardView>
Android 5.0 new features learn--cardview