1

我正在使用以下代码将图像延迟加载到我的 UIImageView 中:

[self.imv1 setImageWithURL:[NSURL URLWithString:myURL]
              placeholderImage:[UIImage imageNamed:@"loading.png"]
                     completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
     {
         // stuff here
     }];

当用户触摸一个按钮时,我希望这个延迟加载完全停止,这样就不会加载任何图像并且图像的下载会停止。

停止延迟加载后,我计划将不同的图像加载到同一个 UIImageView 中。

SDWebImage 可以做到这一点吗?

4

1 回答 1

2

了解如何做到这一点。我只需要这样称呼:

[self.imv1 cancelCurrentImageLoad];
于 2013-06-12T19:06:22.997 回答