// 让图片保存比例
imageView.contentMode = UIViewContentModeCenter;
// iOS 截取图片,并且保持图片原有比例,同时填充imageView
self.homePhotoImage.clipsToBounds = YES;
[self.homePhotoImage setContentScaleFactor:[[UIScreen mainScreen] scale]];
self.homePhotoImage.contentMode = UIViewContentModeScaleAspectFill;
self.homePhotoImage.autoresizingMask = UIViewAutoresizingFlexibleHeight;
UIImageView
最新推荐文章于 2020-11-12 17:03:25 发布