Android去除CardView默认的阴影

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

app:cardElevation="0dp"
app:cardMaxElevation="0dp"
复制代码

完整的使用如下:

<androidx.cardview.widget.CardView 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
    app:cardBackgroundColor="#ffffff"
    app:cardCornerRadius="10dp"
    app:cardElevation="0dp"
    app:cardMaxElevation="0dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        .......
    </LinearLayout>
</androidx.cardview.widget.CardView>
复制代码
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享