【发布时间】:2012-12-31 04:16:16
【问题描述】:
我正在我的 iPhone 应用程序中从网络加载图像。我将此图像用于表格单元格的图像视图。应用程序启动后几秒钟,所有图像都已完全加载。但表格的滚动不流畅。有延迟。滚动发生在手势后几秒钟。还有抽搐。我正在使用此代码
UIImage *imagefromWeb = [UIImage imageWithData:[NSData dataWithContentsOfURL:[IconArray objectAtIndex:indexPath.row]]];
CGSize newSize= CGSizeMake(45.0,45.0);
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
[imagefromWeb drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
cell.imageView.image=newImage;
【问题讨论】:
标签: iphone ios uitableview uiimage