SDWebImage的一些问题

时间:2015-12-30 08:12:58

标签: ios sdwebimage

当我使用方法加载图像时,在下载图像后,直到我选择或滚动单元格才会显示,但如果我没有将placeholderImage设置为nil,则效果很好。我不知道有什么问题。这是我的代码:

[cell.imageView sd_setImageWithURL:(my url) placeholderImage:nil];

SDWebImage的一些问题

3 个答案:

答案 0 :(得分:0)

很奇怪,但是在设置图像以重新加载所有单元格视图后,您可以尝试[cell setNeedsLayout];

我猜你在tableView:cellForRowAtIndexPath:

中有所有电话

答案 1 :(得分:0)

使用完成块来更改图像视图。

[myImage sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:IMG_PLACEHOLDER] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {}];

在您的项目中使用它并尝试。

答案 2 :(得分:-1)

也许您可以使用其他方法来做到这一点,例如:

[_theImageView sd_setImageWithURL:[NSURL URLWithString:_imageUrl]]
相关问题