简体   繁体   English

如何知道UIImageView中的图像大小

[英]How to know the size of image in UIImageView

I have imageView with some frame 我有一些框架的imageView

imageView.frame = CGRectMake(0,0, 100, 100);
imageView.contentMode = UIViewContentModeScaleAspectFit;

imageView.image = myImage;

The question is : 问题是

Is there any property or method in imageview to know the result size of the image after it's resizing (something like this : imageView.image.size) imageview中是否有任何属性或方法在调整大小后知道图像的结果大小(如下所示: imageView.image.size)

(or should i calculate it myself using image size before and imageview frame)? (或者我应该在使用图像尺寸和图像视图帧之前自己计算)?

无法查询缩放图像的大小,您必须使用图像大小和大小限制自行计算。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM