UITableView中改变UIImage分寸的方法

UITableView中改变UIImage尺寸的方法UIImage *image [UIImage imageNamed:@YourImage.png]UIImage *t

UITableView中改变UIImage尺寸的方法

UIImage *image = [UIImage imageNamed:@"YourImage.png"];            UIImage *tempImage = nil;            CGSize targetSize = CGSizeMake(48,48); //你想要的图片尺寸            UIGraphicsBeginImageContext(targetSize);            CGRect thumbnailRect = CGRectMake(0, 0, 0, 0);            thumbnailRect.origin = CGPointMake(0.0,0.0);            thumbnailRect.size.width  = targetSize.width;            thumbnailRect.size.height = targetSize.height;            [image drawInRect:thumbnailRect];            tempImage = UIGraphicsGetImageFromCurrentImageContext();            UIGraphicsEndImageContext();            cell.img.image = tempImage; //这里我是自定义了cell,将Image重置为新的tempImage即可