我有一些UIImage
并在UIImageView
中显示它。
我需要使用UIViewContentModeScaleAspectFit
内容模式。
这是简单的代码:
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
imageView.image = self.image;
imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.view addSubview:imageView];
[imageView release];
如何知道屏幕上显示的图像大小? 有没有解决方案、属性或者我需要手动计算?
编辑:
我知道关于属性
image.size
。
self.image.size
->>> 原始图像大小
imageView.image.size
->>> imageView的大小,而不是所显示图像的大小。我的问题是关于根据
imageView的大小
和它的contentmode
来确定显示大小。