当我在tabelview单元格上显示图像时,我使用的是自定义tabelview单元,而不是所有图像的大小不同如何在iphone 中显示相同大小的所有图像
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];
将UIImageViews的contentMode属性设置为UIViewContentModeScaleToFill、UIViewContentModeScaleAspectFit或UIViewContentMode ScaleAspect Fill之一。。。
cell.imageView.contentMode = UIViewContentModeScaleAspectFit;