2013-02-12 56 views
0

我已加載從文件夾中圖像的tableView與每個row.Even有三張圖片,雖然我調整後的圖像自定義單元格它,它緩慢時向上或向下滾動加載圖像中的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

重量是烏爾問題? – iPatel 2013-02-12 11:39:30

+0

當我滾動向下或向上是需要時間來向上或向下移動 – user2003416 2013-02-12 11:42:27

+0

把UR的cellForRowAtIndexPath方法 – iPatel 2013-02-12 11:44:04

回答

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 for Lazy加載圖像概念。

我不會形容什麼是懶加載,希望這多少對你的作品

+0

@CreazyCreator我已經提到it.little有點困惑你的代碼? – user2003416 2013-02-12 14:09:29