我试图得到 this GIF来自这样的 URL:
Glide.with(context)
.load("http://artfcity.com/wp-content/uploads/2017/07/tumblr_osmx1ogeOD1r2geqjo1_540.gif")
.into(new GlideDrawableImageViewTarget(imageViewBaby) {
@Override
public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) {
super.onResourceReady(drawable, anim);
imageViewBaby.setImageDrawable(drawable);
imageViewBaby.invalidate();
imageViewBaby.requestLayout();
}
});
但是 GIF 不会移动或启动。它就像一个图像!如何解决这个问题?
最佳答案
试试这个
添加依赖
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
动图加载
Glide.with(this)
.load("http://artfcity.com/wp-
content/uploads/2017/07/tumblr_osmx1ogeOD1r2geqjo1_540.gif")
.apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.NONE))
.into(imageView);
关于android - 从 URL 加载 GIF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48013012/