我已经在寻找解决这个问题的方法已有好几个小时了,我知道有些人在我之前遇到了这个问题,但是他们的解决方案对我不起作用。
例如。 app:cardUseCompatPadding="true"
不会删除灰色背景,并且CardElevation已设置为0dp。
此时,我只是不知道还能做什么,希望有人可以帮助我:c
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cardview1"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="50dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="225dp"
android:layout_marginBottom="225dp"
app:cardCornerRadius="20dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@color/colorRedDark">
<RelativLayout>
.
.
.
</RelativeLayout>
</androidx.cardview.widget.CardView>