Glide.with(mContext)
.load(item.getImagePath())
.apply(center)
.apply((RoundedCornersTransformation));
以上方式centerCrop无效,
以下为正确显示的方式,不知道有没有更好的方式
multiLeft = new MultiTransformation<>(new CenterCrop(),new RoundedCornersTransformation(25, 0, RoundedCornersTransformation.CornerType.ALL));
Glide.with(mContext)
.load(item.getImagePath())
.apply(RequestOptions.bitmapTransform(multiLeft))
.into((ImageView) helper.getView(R.id.iv_big_image));
本文介绍使用Glide库进行图片加载时遇到的问题及解决方案,详细解释了如何结合centerCrop和RoundedCornersTransformation实现图片的居中裁剪与圆角效果。通过自定义MultiTransformation,可以有效地解决Glide默认配置下centerCrop失效的问题。
2375

被折叠的 条评论
为什么被折叠?



