你好,对于加载gif我发现如下几个问题:
1.当我点击不同按钮加载不同的gif的时候, 有一个明显的黑屏过渡,也就是gif之间的切换比较缓慢
2.加载gif占用的内存平均为40M,CPU占用平均为30%
3.这是我加载gif的代码, 就这么简单吗?Glide.with(InteractiveActivity.this).load(resId).asGif()
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
// .placeholder(R.mipmap.standby_frame)
.dontAnimate()
.into(imgAnim);
希望您能尽快回复我, 我比较着急解决这个问题
我是本地加载gif的, 并且我的gif源图片在mipmap中存放着
你最好是放个 demo 上来。
我只能提供代码
case ExpressionManager.EXPRESSION_STANDBY:
resId = R.raw.standby;
// resId = R.mipmap.test_one;
break;
case ExpressionManager.EXPRESSION_HEAR:
resId = R.raw.awaken;
// resId = R.mipmap.testt_wo;
break;
//===================================
final WeakReference
ImageView target = imageViewWeakReference.get();
if (target != null) {
Glide.with(InteractiveActivity.this).load(resId).asGif()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.fitCenter()
.dontAnimate()
.into(target);
用的什么机器?什么版本?还是所有的机器都出现这个问题
我们是一个机器人项目, 在一个界面,根据语音交互, 来切换不同的表情, 而这个表情就是用glide的gif来做,希望我能得到答复, 谢谢
感谢你的文章
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
Most helpful comment
https://github.com/FredWe/How-To-Ask-Questions-The-Smart-Way