compile 'com.android.support:cardview-v7:25.0.0'
<!--
CardView_cardBackgroundColor 设置背景色
CardView_cardCornerRadius 设置圆角大小
CardView_cardElevation 设置z轴阴影
CardView_cardMaxElevation 设置z轴最大高度值
CardView_cardUseCompatPadding 是否使用CompadPadding
CardView_cardPreventCornerOverlap 是否使用PreventCornerOverlap
CardView_contentPadding 内容的padding
-->
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/cardview_light_background"
app:cardCornerRadius="8dp"
app:cardElevation="10dp"
app:cardMaxElevation="12dp"
app:cardUseCompatPadding="true"
app:cardPreventCornerOverlap="true"
app:contentPadding="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Im CardView"/>
</android.support.v7.widget.CardView>
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"