滑行无法加载真实图像并卡在占位符上 [英] Glide not loading real image and stuck with placeholder
本文介绍了滑行无法加载真实图像并卡在占位符上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从服务器行代码中获得了一个非常基本的负载图像:
I have a pretty basic load image from server line code:
Glide.with(view.getContext()).load(url).placeholder(R.drawable.default_profile).into(view);
出于某种原因,我总是被占位符所显示,而不是真实的图像!
For some reason, I'm always stuck with the placeholder being displayed and never the real image!
我已确保传递了有效且有效的网址.而且,如果我使用相同的代码但不使用占位符,则效果很好
I have made sure that a valid and working url is being passed. And, if I use the same code without the placeholder it works fine
Glide.with(view.getContext()).load(url).into(view);
有什么想法吗?
推荐答案
尝试添加.dontAnimate()
它也是由 TransitionDrawable 引起的,似乎是因为滚动后没有动画,因为已缓存.
Try to add .dontAnimate()
It caused by TransitionDrawable too and it seems so because after scroll there's no animation because it's cached.
正确的代码是
Glide.with(view.getContext()).load(url).placeholder(R.drawable.default_profile).dontAnimate().into(view);
希望对您有所帮助.
这篇关于滑行无法加载真实图像并卡在占位符上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文