设置ios中imageView图片自适应,

UIIimageView  *imageView = [UIImageView alloc]init];

 

[imageView setContentScaleFactor:[[UIScreen mainScreen] scale]];
 imageView.contentMode =  UIViewContentModeScaleAspectFill;
 imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
 imageView.clipsToBounds  = YES;

 

设置图片的显示格式不会出现拉伸或者变形的情况

posted @ 2015-12-04 11:06  蓝色的风1203  阅读(1536)  评论(0编辑  收藏  举报