我已经从tableView中的文件夹中加载了图像,其中自定义单元格在每行中有三个图像。即使我调整了图像大小,但向上或向下滚动时它会变慢
-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"cell";
CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = customCell;
}
if ([imageLists count] > indexPath.row*noOfImageInRow) {
ImagesClass *Obj1 = [imageLists objectAtIndex:indexPath.row*noOfImageInRow];
UIImage *image1 = [self getImageForImageId:Obj1.imageId FromPath:SAVEDIMAGE_DIR];
Obj1.thumbImage = [self imageWithImage:image1 convertToSize:CGSizeMake(130, 130)];
[cell setImage:1 :Obj1.thumbImage RowNo:indexPath.row*noOfImageInRow];
答案 0 :(得分:0)
表格视图中没有延迟加载
[cell setImage:2 :Obj2.thumbImage RowNo:indexPath.row*noOfImageInRow+1];
这些功能需要更多时间来执行
UIImage *image1 = [self getImageForImageId:Obj1.imageId FromPath:SAVEDIMAGE_DIR];
Obj1.thumbImage = [self imageWithImage:image1 convertToSize:CGSizeMake(130, 130)];
请参阅Apple以获取延迟加载图像概念。
我不会描述什么是延迟加载,希望这对你有用