NSURL *url=[NSURLURLWithString:@"http://demo.gnway.com:8000/Icons/5.ico"];
NSData *data=[NSData dataWithContentsOfURL:url];
UIImage *tmpimage=[[UIImage alloc] initWithData:data];
UIImageView *imageview =[[UIImageView alloc]initWithFrame:CGRectMake(100,
100, 100, 100)];
imageview.image=tmpimage;
[self.view addSubview:imageview];
NSData *data=[NSData dataWithContentsOfURL:url];
UIImage *tmpimage=[[UIImage alloc] initWithData:data];
UIImageView *imageview =[[UIImageView alloc]initWithFrame:CGRectMake(100,
100, 100, 100)];
imageview.image=tmpimage;
[self.view addSubview:imageview];
本文介绍了如何通过URL获取图片数据,并使用Objective-C语言将其转换为UIImage对象,然后将图片展示在UIImageView上。
3764

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



