Glide4加载图片RoundedCorners跟CenterCrop冲突问题解决
在glide4.0上面 centerCrop和圆角图片有冲突只能显示一个 类似这个: Glide.with(TPApplication.getAppContext()) .load(url) .centerCrop() .transform(glideRoundTransform) .placeholder(R.drawable.nearby_online_me_photo) .diskCacheStrategy(DiskCacheStrategy.ALL) .dontAnimate() .into(this); 分析 点开centerCrop()这个代。 /** * Applies {@link CenterCrop} to all default types and * throws an exception if asked to transform an unknown type. * * <p>this will override previous calls to {@link #dontTransform()} ()}. * * @see #transform(Class, Transformation) * @see #optionalCenterCrop() */ public RequestOptions centerCrop() { return transform(DownsampleStrategy.CENTER_OUTSIDE, new CenterCrop()); } 可以看到CenterCrop也是调用的 transform的方法,在点开 new Centercrop()这个方法看看里面的实现...