UIImageView *imageView = [[UIImageView alloc] init];
// 防止图片变形
imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.clipsToBounds=YES;// 是否剪切掉超出 UIImageView 范围的图片
[imageView setContentScaleFactor:[[UIScreen mainScreen] scale]];
_imageView = imageView;
[self addSubview:imageView];
防止图片压缩的处理
网友评论