背景
项目中需要对图片进行圆角显示,并居中裁剪,使用glide时,发现这两种会出现冲突,只能显示一种效果. 目标效果图:
private fun centerCropAndRoundCornerImg() {
Glide.with(this)
.load(url)
.transform(MultiTransformation(CenterCrop(), RoundedCorners(20)))
.into(roundCornerAndCenterCropIv)
}
#Demo源代码: https://gitee.com/cxyzy1/glideDemo.git