學(xué)習(xí)1:CardView的使用

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"

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容