Created
February 27, 2019 02:15
-
-
Save edwardean/640ad6c5358dc5fc32a6871098ec38fb to your computer and use it in GitHub Desktop.
获取UIImageView上显示UIImage之后的实际大小
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGRect rect = AVMakeRectWithAspectRatioInsideRect(self.imageView.image.size, self.imageView.frame); | |
if (!(isnan(rect.origin.x) || isnan(rect.origin.y) || | |
isnan(rect.size.width) || isnan(rect.size.height))) { | |
self.imageView.frame = rect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment