我创建了一个每行tableView
有customCell
三个图像的图像。我从文件夹中加载了图像。当我向上或向下滚动时,tableView
需要时间向上或向下移动。我发现了一些概念,例如缓存和延迟加载,它们是从服务器加载的图像。我不知道如何在我的应用程序中使用它。
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];
}
if ([imageLists count] > indexPath.row*noOfImageInRow+1) {
ImagesClass *Obj2 = [imageLists objectAtIndex:indexPath.row*noOfImageInRow+1];
UIImage *image1 = [self getImageForImageId:Obj2.imageId FromPath:SAVEDIMAGE_DIR];
Obj2.thumbImage = [self imageWithImage:image1 convertToSize:CGSizeMake(130, 130)];
[cell setImage:2 :Obj2.thumbImage RowNo:indexPath.row*noOfImageInRow+1];
}
if ([imageLists count] > indexPath.row*noOfImageInRow+2) {
ImagesClass *Obj3 = [imageLists objectAtIndex:indexPath.row*noOfImageInRow+2];
UIImage *image1 = [self getImageForImageId:Obj3.imageId FromPath:SAVEDIMAGE_DIR];
Obj3.thumbImage = [self imageWithImage:image1 convertToSize:CGSizeMake(130, 130)];
[cell setImage:3 :Obj3.thumbImage RowNo:indexPath.row*noOfImageInRow+2];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.delegate = self;
return cell;