我正在尝试加载缩略图图像首先,然后请求原始版本的图像,但没有得到响应的原始图像请求。
[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;
}
}];
}
}
}];谢谢..
发布于 2015-10-21 21:01:34
试一下这个案例
[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");
}];
}
}];发布于 2015-10-23 16:56:57
我用以下代码解决了我的问题
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
}
}];
}
}];https://stackoverflow.com/questions/33259611
复制相似问题