cell.imageView.image的大小 会随着Cell的高度而变化,不同的图片显示的也不一样
解决方案:
//1、首先对image付值
cell.imageView.image=[UIImage imageNamed:@"imagename"];
//2、调整大小
CGSize itemSize = CGSizeMake(40, 40);
UIGraphicsBeginImageContextWithOptions(itemSize, NO, UIScreen.mainScreen.scale);
CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
[cell.imageView.image drawInRect:imageRect];
cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();