how can I get the scale factor of a UIImageView who's mode is AspectFit?

前端 未结 2 1738
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 01:15

how can I get the scale factor of a UIImageView who\'s mode is AspectFit?

That is, I have a UIImageView with mode AspectFit. The image (square) is scaled to my UIIm

2条回答
  •  感动是毒
    2020-12-15 01:38

    Well you could do something like

    CGFloat widthScale = imageView.image.size.width / imageView.frame.size.width;
    CGFloat heightScale = imageView.image.size.height / imageView.frame.size.height;
    

    Let me know if that works for you.

提交回复
热议问题