У меня проблема с непрозрачностью фона CardView. Я хочу сделать свой фон полупрозрачным, но у меня есть странная ошибка, которая происходит постоянно. Лучшим объяснением будет скриншот из моей программы.
Scr из отображаемого макета
Я хочу, чтобы этот макет был одного и того же полупрозрачного цвета. Вместо этого появляется полупрозрачный цвет с более прозрачным прямоугольником внутри. Я не знаю, как удалить этот прямоугольник из моего макета. Код:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="15dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:cardBackgroundColor="#66000000">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="15dp">
<ImageView
android:id="@+id/flagImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:fontFamily="@font/changa_light"
android:scaleType="fitXY"
app:srcCompat="@mipmap/ic_launcher" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/flagTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST"
android:textColor="#ffffff"
android:gravity="center"
android:fontFamily="@font/changa_light"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</RelativeLayout>