UIImage scale propotionally
I have a UIImageView. and i am setting a UIImage to this UIImageView with content mode as UIConte开发者_StackOverflowntModeScaleAspectFit. Can i know the scale in which the UIImage is resizing when using UIContentModeScaleAspectFit.
Yes, but not automatically :)
The scale will be something like
CGFloat widthScale = imageView.bounds.size.width / image.size.width;
CGFloat heightScale = imageView.bounds.size.height / image.size.height;
You will have to use the correct one depending on if the image has fitted vertically or horizontally ;)
精彩评论