老婆保佑,代碼無(wú)BUG
目錄
- 一:屬性介紹
- 二: card添加說(shuō)波紋效果
引用
compile 'com.android.support:cardview-v7:23.4.0'
一:屬性介紹
屬性名稱(chēng) | 說(shuō)明 |
---|---|
app:cardBackgroundColor | 這是設(shè)置背景顏色 |
app:cardCornerRadius這是 | 設(shè)置圓角大小 |
app:cardElevation | 這是設(shè)置z軸的陰影 |
app:cardMaxElevation | 這是設(shè)置z軸的最大高度值 |
app:cardUseCompatPadding | 是否使用CompatPadding |
app:cardPreventCornerOverlap | 是否使用PreventCornerOverlap |
app:contentPadding | 設(shè)置內(nèi)容的padding |
app:contentPaddingLeft | 設(shè)置內(nèi)容的左padding |
app:contentPaddingTop | 設(shè)置內(nèi)容的上padding |
app:contentPaddingRight | 設(shè)置內(nèi)容的右padding |
app:contentPaddingBottom | 設(shè)置內(nèi)容的底padding |
二: card添加說(shuō)波紋效果
android:focusable="true"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
添加這3個(gè)屬性就行了
Untitled4.gif
git 圖 感覺(jué)看不出什么效果。無(wú)奈....