Skip to content

Instantly share code, notes, and snippets.

@edwardean
Created February 27, 2019 02:15
Show Gist options
  • Save edwardean/640ad6c5358dc5fc32a6871098ec38fb to your computer and use it in GitHub Desktop.
Save edwardean/640ad6c5358dc5fc32a6871098ec38fb to your computer and use it in GitHub Desktop.
获取UIImageView上显示UIImage之后的实际大小
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