有什么办法可以阻止从iOS上的SDWebImage延迟加载UIImageView中的图像?
问题描述:
我正在使用以下代码将图像延迟加载到我的UIImageView中:
I'm using the following code to lazy load an image into my UIImageView:
[self.imv1 setImageWithURL:[NSURL URLWithString:myURL]
placeholderImage:[UIImage imageNamed:@"loading.png"]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
{
// stuff here
}];
当用户触摸按钮时,我希望此按钮的延迟加载完全停止,以便不加载任何图像,并停止下载图像.
When a user touches a button, I want the lazy loading of this to STOP completely, so that no image gets loaded and the download of the image stops.
在我停止延迟加载之后,我计划将不同的图像加载到同一UIImageView中.
After I stop the lazy loading, I plan to load a different image into the same UIImageView.
使用SDWebImage可以吗?
Is this possible with SDWebImage?
答
了解如何执行此操作.我只需要叫这个:
Found out how to do it. I just needed to call this:
[self.imv1 cancelCurrentImageLoad];