在任何人复制之前。我之前在滑动的v3.7.0中使用了以下代码。现在,当我将其更新为4.7.1时,它显示错误:找不到符号方法crossFade()。
我在不同的地方搜索过但无法获得代码。
Glide.with(this)
.load(uriProfileImage)
.crossFade()
.bitmapTransform(new CircleTransform(EditProfile.this))
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(changeImage);
我自己没有使用过Glide,但基于this v4 documentation看起来你需要使用过渡和TransitionOptions
来指定交叉淡入淡出,所以你的代码看起来像这样:
import static com.bumptech.glide.load.resource.drawable.BitmapTransitionOptions.withCrossFade;
...
Glide.with(this)
.load(uriProfileImage)
.transition(withCrossFade())
.bitmapTransform(new CircleTransform(EditProfile.this))
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(changeImage);
(我假设你想要BitmapTransitionOptions
而不是DrawableTransitionOptions
,给出bitmapTransform
电话。)
您也应该阅读有关交叉淡入淡出的"common errors"部分。
我有同样的问题,使用旧版本解决问题。实现'com.github.bumptech.glide:glide:3.7.0'比实现'com.github.bumptech.glide:glide:4.9.0'这是最后一个版本