Glide v4中的占位符/错误/回退 [英] Placeholder/Error/Fallback in Glide v4

查看:144
本文介绍了Glide v4中的占位符/错误/回退的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的是最新版本的Glide,该版本为 glide:4.0.0-RC1 ,并且无法找到占位符,错误,回退等方法.可能他们为此提供了替代方案,但我没有得到.有人知道此版本中有替代方案吗?

i am using latest version of Glide as of now which is glide:4.0.0-RC1 and not able to find methods like placeholder, error, fallback e.t.c. Probably they have provided alternate for it but i am not getting it. Anybody know about there alternatives in this release?

推荐答案

尝试一下

RequestOptions requestOptions = new RequestOptions();
requestOptions.placeholder(R.mipmap.ic_launcher);
requestOptions.error(R.drawable.error_img);

Glide.with(this)
                .setDefaultRequestOptions(requestOptions)
                .load("")
                .into(imageViewPlaceholder);

这篇关于Glide v4中的占位符/错误/回退的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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