SDWebImage 的一些问题

Some problems with SDWebImage

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

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

SDWebImage 的一些问题

也许你可以用另一种方法来做到这一点,例如:

[_theImageView sd_setImageWithURL:[NSURL URLWithString:_imageUrl]]

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

我猜你里面有所有的电话tableView:cellForRowAtIndexPath:

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

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

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