Android去除CardView默认的阴影

Android去除CardView默认的阴影,第1张

平时使用CardView默认是带有阴影效果的,如果不想要阴影效果,只需要将以下属性设置为0即可:

app:cardElevation="0dp"
app:cardMaxElevation="0dp"
<androidx.cardview.widget.CardView
    android:id="@+id/card_view"
    android:layout_width="match_parent"
    android:layout_height="188dp"
    android:background="@color/transparent"
    android:foreground="?android:attr/selectableItemBackground"
    app:cardCornerRadius="12dp"
    app:cardElevation="0dp"
    app:cardMaxElevation="0dp">
</androidx.cardview.widget.CardView>

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/889227.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-14
下一篇 2022-05-14

发表评论

登录后才能评论

评论列表(0条)

保存