SDWebImage加载图片URL第一次失败,后面图片URL存在不刷新的问题
2016-12-21 17:27
1131 查看
业务需求,有时候会首先出现图片的网络URL地址,但是并没有显示出来,使用SDWebImage显示图片如下
self.itemImageView sd_setImageWithURL:<#(nullable NSURL *)#>];
但是发现,后面有图片了,再去刷新,无论如何也刷新不出来这图片。
最后发现SDWebImage里面有个说明,如果加载某个图片的URL失败,SDWebImage会把这个地址加入一个黑名单,后面就不会再重新加载这个URL请求。
* By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying.
但是有个Option标签,可以解决这个问题
/**
* By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying.
* This flag disable this blacklisting.
*/
[self.itemImageView sd_setImageWithURL:[NSURL URLWithString:imgUrlStr] placeholderImage:[UIImage imageNamed:@"iv_message_failed"] options:SDWebImageRetryFailed];
self.itemImageView sd_setImageWithURL:<#(nullable NSURL *)#>];
但是发现,后面有图片了,再去刷新,无论如何也刷新不出来这图片。
最后发现SDWebImage里面有个说明,如果加载某个图片的URL失败,SDWebImage会把这个地址加入一个黑名单,后面就不会再重新加载这个URL请求。
* By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying.
但是有个Option标签,可以解决这个问题
/**
* By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying.
* This flag disable this blacklisting.
*/
[self.itemImageView sd_setImageWithURL:[NSURL URLWithString:imgUrlStr] placeholderImage:[UIImage imageNamed:@"iv_message_failed"] options:SDWebImageRetryFailed];
相关文章推荐
- SDWebImage加载图片url失败后再次请求无法刷新
- 【iOS开发】SDWebImage框架,加载图片,失败之后,居然直接跳过不再去请求网络数据了?
- SDWebImage使用SDWebImageRefreshCached后,图片没有刷新的问题讨论
- SDWebImage加载图片问题
- SDWebImage加载Https图片失败的解决方法
- SDWebImage 图片加载失败
- 解决使用SDWebImage加载图片,图片为空的问题
- 解决:SDWebImage异步请求图片失败,图片没有加载出来
- ios-使用SDWebImage加载Gif图片的问题
- SDWebImage 加载图片不显示问题
- 完美解决SDWebImage加载多个图片内存崩溃的问题
- 使用SDWebImage加载图片问题总结
- SDWebImage 加载网络图片失败,重新运行,就能加载成功。
- sd_setImageWithURL加载图片失败原因以及处理方法
- SDWebImage 加载图片异常问题
- 1.用SDWebImage为UIImageView加载图片时遇到的问题
- 使用SDWebImage为imageView设置图片,存在的图片大小异常问题
- iOS中使用SDWebImage加载图片失败之后如何重新加载
- iOS 使用SDWebImage加载gif链接图片时内存过大问题
- iOS开发 - 完美解决SDWebImage加载多个图片内存崩溃的问题