首页 > 使用sd_setImageWithURL的问题

使用sd_setImageWithURL的问题

NSURL *url = [NSURL URLWithString:head];
NSLog(@"%@", url);
[cell.image sd_setImageWithURL:url placeholderImage:nil];
 

使用浏览器加载url图片与用sd_setImageWithURL加载出来的图片不同, 是为什么啊?


确认一下你的head里没有中文以及其他 url 非法字符吧。如果有的话,需要先 encode。

并且,SDWebImage 是有缓存的。可以把 app 删掉重新装,看看是不是缓存的问题。


是因为SDWebImage 的缓存的问题 因为图片的url没有变所以影响了SDWebImage的使用,

 [[SDImageCache sharedImageCache] removeImageForKey:head];
  NSURL *url = [NSURL URLWithString:head];
 [cell.image sd_setImageWithURL:url];

这样写就好了


这一句代码看不出来为什么
访问浏览器的url 和 上面的url 相同么? cell有重用么?

【热门文章】
【热门文章】