CardView is a 5.0 or more version of the control, is a card-style layout, inherits the Framlayout, but can use Compatibility Pack older compatible with more than 4.0 devices.
Test environment is Android studio
1. Join the dependency:
<span style= "FONT-SIZE:14PX;" >compile ' com.android.support:cardview-v7:21.0.3 ' </span>
2. Write the layout:
<span style= "FONT-SIZE:14PX;" ><android.support.v7.widget.cardview xmlns:android= "http://schemas.android.com/apk/res/android" xmlns : app= "Http://schemas.android.com/apk/res-auto" android:id= "@+id/card_view" android:layout_width= "match _parent " android:layout_height=" wrap_content " app:cardcornerradius=" 4DP " app:cardbackgroundcolor=" @color/style_color_primary "> <linearlayout android:layout_width=" Match_parent " android: layout_height= "Wrap_content" > <textview android:layout_width= "wrap_content" android:layout _height= "Wrap_content" android:text= "Hello cardview!" /> </LinearLayout></android.support.v7.widget.CardView></span>
Note: There are two properties Cardcornerradius and Cardbackgroundcolor, which are basically known for their meaning, the first is the fillet radius and the second is the background color.
There is also a elevator attribute, but only if the version is more than 5.0 can show the effect.
Android-cardview Simple to use