【发布时间】:2020-08-14 22:00:15
【问题描述】:
我正在使用新的 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" />
<style name="CircleImageView">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">50%</item>
</style>
【问题讨论】:
-
参考此链接:gist.github.com/gabrielemariotti/…,如果您仍然遇到任何问题,请说明您使用的是什么版本。
-
1.2.0 和 1.2.1 出现同样的问题
-
原来这只是一个预览问题,如果你运行应用程序你不应该看到黑色背景
-
不知何故,我仍然在片段转换过程中看到了这一点。任何线索如何摆脱?
标签: android kotlin android-xml