2012-03-21 65 views
0

我使用自定义tabelview单元格时,我显示tabelview单元格上的图像比所有图像大小不同如何显示所有图像中相同大小的iphone修复图像大小oncustom tabelview我正在使用cell.imageview属性

NSString *str=[self.uploadimagearry objectAtIndex:indexPath.row]; 
    NSURL *uploadimageURL = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 
    // NSData *imgdata=[NSData dataWithContentsOfURL:uploadimageURL]; 

    //UIImage * uploadimage = [UIImage imageWithData:imgdata]; 
    cell.imageView.frame=CGRectMake(0, -15, 40, 35); 
    //[[cell imageView] setContentMode:UIViewContentModeScaleAspectFit]; 
     cell.autoresizesSubviews=NO; 

    [cell.imageView setImageWithURL:uploadimageURL placeholderImage:[UIImage imageNamed:@"loading.png"]]; 

    cell.textLabel.text=[imageidarry objectAtIndex:indexPath.row]; 

回答

0

设置上的UIImageViews到UIViewContentModeScaleToFill,UIViewContentModeScaleAspectFit或UIViewContentModeScaleAspectFill之一contentMode属性...

cell.imageView.contentMode = UIViewContentModeScaleAspectFit;