1.引用?
????implementation'com.android.support:cardview-v7:27.1.1'
2.屬性?
????app:cardBackgroundColor ? ? ?設(shè)置背景顏色
????app:cardCornerRadius ? ? ? ? 設(shè)置圓角大小
????app:cardElevation ? ? ? ? ? ?設(shè)置z軸陰影高度
????app:cardMaxElevation ? ? ? ? 設(shè)置z軸最大高度值
????app:contentPadding ? ? ? ? ? 內(nèi)容與邊距的間隔
? ? ?app:contentPaddingLeft ? ? ? 內(nèi)容與左邊的間隔
????app:contentPaddingTop ? ? ? ?內(nèi)容與頂部的間隔
????app:contentPaddingRight ? ? ?內(nèi)容與右邊的間隔
????app:contentPaddingBottom ? ? 內(nèi)容與底部的間隔? ??
? ? ?app:paddingStart ? ? ? ? ? ? 內(nèi)容與邊距的間隔起始
????app:paddingEnd內(nèi)容與邊距的間隔終止
????app:cardUseCompatPadding ? ? 設(shè)置內(nèi)邊距,在API21及以上版本和之前的版本仍舊具有一樣的計(jì)算方式
????app:cardPreventConrerOverlap 在API20及以下版本中添加內(nèi)邊距,這個(gè)屬性為了防止內(nèi)容和邊角的重疊
3.波紋點(diǎn)擊效果
????android:foreground="?android:attr/selectableItemBackground"
4.設(shè)置陰影
? ??app:cardUseCompatPadding="true"