【发布时间】:2011-08-13 22:52:06
【问题描述】:
我在我的应用程序中使用 tabbar、navigationBar 和 SegmentedBar。
我必须像这样显示来自 HTTP 的图片:
- (void)viewDidLoad {
[super viewDidLoad];
// build the URL, perform the request and show the picture
NSURL *url = [NSURL URLWithString: @"http://api.clementhallet.be/15avril.png"];
//UIImage
[[UIImageView alloc] initWithImage:image];
image = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
image.frame = CGRectMake(0, 0, 100, 100);
[self.view addSubview:[[UIImageView alloc] initWithImage:image]];
}
它正在运行,但图片不是我想要的 [确切][1]。
谢谢你的帮助!
【问题讨论】:
标签: iphone objective-c uiimage nsurl image