NSURL *url = [NSURL URLWithString: @"http://www.baidu.com/img/baidu_sylogo1.gif"];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 300, 340)];
imgView.image =[UIImage imageWithData: [NSData dataWithContentsOfURL: url ] ];
[self.view addSubview:imgView];
[imgView release];
本文详细介绍了如何使用Objective-C编程语言创建UIImageView对象,并通过URL加载网页中的图片资源,实现动态显示图片的功能。

被折叠的 条评论
为什么被折叠?



