最佳答案
实现“com.github.bumptech.glide:glide:4.10.0”
XML
<FrameLayout
android:id="@+id/fl_image"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="10dp"
android:background="@drawable/card_circle_background"
android:elevation="8dp">
<ImageView
android:id="@+id/iv_item_employee"
android:layout_width="60dp"
android:layout_height="60dp"
tools:background="@color/colorPrimary" />
</FrameLayout>
形状可绘制
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/white"/>
</shape>
Glide 配置
Glide.with(this)
.asBitmap()
.load(item.image)
.apply(RequestOptions.circleCropTransform())
.into(iv_item_employee)
关于android - 如何在 glide 4 中为圆形裁剪图像制作阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49400855/