如何在Glide/Picasso/Ion等的占位符中加载gif图像 [英] How to load gif image in placeholder of Glide/Picasso/Ion etc

查看:662
本文介绍了如何在Glide/Picasso/Ion等的占位符中加载gif图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到用于在占位符中加载gif图像的完美解决方案

Not able to find perfect solution for loading a gif image in placeholder

Glide
     .with(context)
     .load("imageUrl")
     .asGif()
     .placeholder(R.drawable.gifImage) 
     .crossFade()
     .into(imageView)

也尝试了Glide 3.7.0版的asGif()属性.但是没有运气!

Tried asGif() property of Glide version 3.7.0 too. But no Luck!

推荐答案

这是最好的方法.

 Glide.with(getContext()).load(item[position])
                .thumbnail(Glide.with(getContext()).load(R.drawable.preloader))
                .fitCenter()
                .crossFade()
                .into(imageView);

这篇关于如何在Glide/Picasso/Ion等的占位符中加载gif图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆