欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

UIImageView居中裁剪显示

程序员文章站 2022-04-09 08:05:42
...

UIImageView *pictureImg1 = (UIImageView *)[cell viewWithTag:102 + i];
[pictureImg1 setContentScaleFactor:[[UIScreen mainScreen] scale]];
pictureImg1.contentMode = UIViewContentModeScaleAspectFill;
pictureImg1.autoresizingMask = UIViewAutoresizingFlexibleHeight;
pictureImg1.clipsToBounds = YES;