iOS 异步加载图片 使用EGOImageView、SDWebImage按步骤使用的,就是不能显示图片
EGOImageView*egoView=[[EGOImageViewalloc]initWithPlaceholderImage:[UIImageimageNamed:...
EGOImageView *egoView = [[EGOImageView alloc]initWithPlaceholderImage:[UIImage imageNamed:@"user_head_img"]];
egoView.frame = CGRectMake(10 + 100 * x, 10 + 100 * y, 90, 90);
egoView.imageURL = [NSURL URLWithString:imagePath];
[self.scrollView addSubview:egoView];
//
UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(10 + 100 * x, 10 + 100 * y, 90, 90)];
[imgView setImageWithURL:[NSURL URLWithString:imagePath] placeholderImage:[UIImage imageNamed:@"user_head_img"]];
[self.scrollView addSubview:imgView];
//这两段代码都不行!!!
当我用UIWebView时,就可以正常使用,但是,这不是异步加载呀!
UIWebView *imageView = [[UIWebView alloc]init];
imageView.scalesPageToFit=YES;
NSURL *contentViewUrl = [NSURL URLWithString:imagePath];
NSURLRequest *request = [NSURLRequest requestWithURL:contentViewUrl];
[imageView loadRequest:request];
imageView.frame = CGRectMake(10 + 100 * x, 10 + 100 * y, 90, 90); 展开
egoView.frame = CGRectMake(10 + 100 * x, 10 + 100 * y, 90, 90);
egoView.imageURL = [NSURL URLWithString:imagePath];
[self.scrollView addSubview:egoView];
//
UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(10 + 100 * x, 10 + 100 * y, 90, 90)];
[imgView setImageWithURL:[NSURL URLWithString:imagePath] placeholderImage:[UIImage imageNamed:@"user_head_img"]];
[self.scrollView addSubview:imgView];
//这两段代码都不行!!!
当我用UIWebView时,就可以正常使用,但是,这不是异步加载呀!
UIWebView *imageView = [[UIWebView alloc]init];
imageView.scalesPageToFit=YES;
NSURL *contentViewUrl = [NSURL URLWithString:imagePath];
NSURLRequest *request = [NSURLRequest requestWithURL:contentViewUrl];
[imageView loadRequest:request];
imageView.frame = CGRectMake(10 + 100 * x, 10 + 100 * y, 90, 90); 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询