开发者

Loading Images issue in UITableViewCell

开发者 https://www.devze.com 2023-01-24 19:58 出处:网络
I get image开发者_JS百科s from a URL using XML Parsing. I loaded the all images from url in to UITableViewCell using Parsing. But when I press the scrollbar in UITableView, it make slowly to loading i

I get image开发者_JS百科s from a URL using XML Parsing. I loaded the all images from url in to UITableViewCell using Parsing. But when I press the scrollbar in UITableView, it make slowly to loading images.

I used the following code.

NSString *image1 =[images objectAtIndex:indexPath.row];
NSLog(@"Images  .....   = %@",image1);
NSData *mydata = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[images objectAtIndex:indexPath.row]]];
UIImage *myimage = [[UIImage alloc] initWithData:mydata];
UIImageView *imageView = [ [ UIImageView alloc ] initWithImage: myimage ];
imageView.frame = CGRectMake(0.0f, 00.0f, 60.0f, 63.0f); 
[cell.contentView addSubview:imageView];

How can I increase the loading speed?


Take a look at Apple's LazyTableImages example.

0

精彩评论

暂无评论...
验证码 换一张
取 消