How to display .gif file in imageview?

后端 未结 8 1803
无人及你
无人及你 2020-12-13 20:26

My layout have lots of imageviews. I want to show .gif animated file in just one imageview. I tried Yash method (Adding gif image in an ImageView in android) but .gif file s

8条回答
  •  孤城傲影
    2020-12-13 20:59

    Use Glide(https://github.com/bumptech/glide):

    GlideDrawableImageViewTarget imageViewTarget = new GlideDrawableImageViewTarget(imageview);
    
            Glide.with(this).load(R.raw.mygif).into(imageViewTarget);
    

提交回复
热议问题