ShapeableImageView 有黑色覆盖

cpg*_*en2 12 android android-xml kotlin

我正在使用新的 ShapeableImageView 制作圆形图像,但叠加层显示为黑色。我怎样才能使它透明?这是它的样子:

在此处输入图片说明

这是代码:

<com.google.android.material.imageview.ShapeableImageView
        android:id="@+id/app_icon"
        android:layout_width="100dp"
        android:layout_height="100dp"
        app:layout_constraintBottom_toTopOf="@+id/guideline2"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:shapeAppearanceOverlay="@style/CircleImageView"
        app:srcCompat="@mipmap/ic_launcher_round" />
Run Code Online (Sandbox Code Playgroud)
<style name="CircleImageView">
        <item name="cornerFamily">rounded</item>
        <item name="cornerSize">50%</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

ysf*_*yln 19

就像评论中提到的@Matteo Innnocenti 一样,这只是一个预览问题,当您运行应用程序时,您不应该看到黑色背景

为了让更多人看到我将其发布为答案