我首先尝试加载缩略图,然后请求原始版本的图片,但没有获得原始图片请求的响应。
[imageView sd_setImageWithURL:thumbUrl completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if (image) {
imageView.image = image;
if (originalUrl != nil) {
[imageView sd_setImageWithURL:originalUrl placeholderImage:image completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL){
if (image) {
imageView.image = image;
}
}];
}
}
}];
谢谢..
答案 0 :(得分:0)
试试这个案例
[imageView sd_setImageWithURL:thumbUrl completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if (originalUrl != nil) {
[imageView sd_setImageWithURL:originalUrl placeholderImage:image completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL){
}];
}
}
}];
这一个:
[[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:path]
options:nil
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (image)
{
[self.artworkImageView sd_setImageWithURL:[NSURL URLWithString:path2] placeholderImage:image
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if (image)
NSLog(@"magic");
}];
}
}];
答案 1 :(得分:0)
我用以下代码解决了我的问题
UIImageView * hiddenImageView = [[UIImageView alloc] init];
[hiddenImageView sd_setImageWithURL:thumbUrl completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if (image) {
mImageView.image = image;
}
if (originalUrl != nil) {
[mImageView sd_setImageWithURL:originalUrl placeholderImage:image completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL){
if (image) {
mImageView.image = image; // optional
}
}];
}
}];