【发布时间】:2013-03-03 17:33:24
【问题描述】:
我正在使用以下代码
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 设置图像视图后不会立即使用?
-
我正在成功地使用我的答案。
标签: ios afnetworking drawrect