本文介绍了更快速地从URL加载图像并将其显示在iPhone应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码在我的ImageView中显示图像:
I am using the following code to display an image in my ImageView:
imgbackBG.image = [UIImage imageWithData:
[NSData dataWithContentsOfURL:
[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", [test.arrImagessplash objectAtIndex:[test.arrImages count]-4]]]]];
4cing.com/mobile_app/uploads/pageicon/splash.png
问题是代码执行速度非常慢。有没有办法加载图像并更快地在ImageView中显示它?如果是这样,我该怎么做?
The problem is that the code executes very slowly. Is there a way to load the image and display it in the ImageView more quickly? If so, how can I do this?
推荐答案
从这里下载文件......
Download the Files from here.....
并按以下方式使用:
AsyncImageView *asyncImageView = [[AsyncImageView alloc]initWithFrame:CGRectMake(30,32,100, 100)];
[asyncImageView loadImageFromURL:[NSURL URLWithString:your url]];
[YourImageView addSubview:asyncImageView];
[asyncImageView release];
这篇关于更快速地从URL加载图像并将其显示在iPhone应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!