Tag Archives: Glide

Android中如何使用Glide实现centerInside

用过Glide的都知道,Glide中没有像Picasso中一样的centerInside函数,也就是长或者宽恰好撑满imageview并且比例不变。

如何实现呢,可以参考作者给出的方案:https://github.com/bumptech/glide/issues/591

小结一下,需要同时满足2个条件:

1、ImageView设置为centerInside(或者如果你允许失真要撑满宽度或者高度的的话setAdjustViewBounds也行)

2、在request最后[......]

继续阅读