0
我用下面的代码的drawRect和AFNetworking
self.imageView = [[UIImageView alloc] init];
[self.imageView setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"profile-image-placeholder"]];
[self setNeedsLayout];
[self setNeedsDisplay];
但在drawRect中无法看到的图像只是占位符使用在这以下
[self.imageView.image drawAtPoint:CGPointMake(15.0f, 5.0f)];
什么想法?
您知道远程图像在您的imageView下载完成后将可用,这将在使用其URL设置图像视图后立即生效。 – Till 2013-03-03 17:59:16
我正在用我的答案成功。 – 2013-04-03 02:16:26