我有我的 UIImageView 并在其中放入了我调整大小的图像:
UIImageView *attachmentImageNew = [[UIImageView alloc] initWithFrame:CGRectMake(5.5, 6.5, 245, 134)];
attachmentImageNew.image = actualImage;
attachmentImageNew.backgroundColor = [UIColor redColor];
attachmentImageNew.contentMode = UIViewContentModeScaleAspectFit;
我尝试UIImageView
通过这样做来获得调整后图片的宽度:
NSLog(@"Size of pic is %f", attachmentImageNew.image.size.width);
但它实际上返回了原始图片的宽度。关于如何获得我在屏幕上看到的图片框架的任何想法?
编辑:这是我的UIImageView
样子,红色区域是它backgroundColor