问题
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.
After I stop the lazy loading, I plan to load a different image into the same UIImageView.
Is this possible with SDWebImage?
回答1:
Found out how to do it. I just needed to call this:
[self.imv1 cancelCurrentImageLoad];
来源:https://stackoverflow.com/questions/17073240/is-there-any-way-to-stop-an-image-in-a-uiimageview-from-lazy-loading-with-sdwebi