I try to show a GIF image as loading placeholder in image view - with Glide Library:
Glide.with(context)
.load(ImageUrl())
.placeholder(R.drawable.loading2)
.asGif()
.crossFade()
.into(image);
I try to show this file
loading2.gif
but get this error :
Error:(54, 86) error: cannot find symbol method asGif()
How can I show GIF file with Glide in a imageView?
I'm using Glide version 4.11 and for me it did work setting
.asGif()
right afterGlide.with(context)
.But I had another problem, I've also set
.dontAnimate()
when loading gif into ImageView. Apparently this doesn't work, so I had to remove.dontAnimate()
from my setup, and everything worked after that change.Here is issue for more info https://github.com/bumptech/glide/issues/3395