圖片框圓角處理(UIImageView):
導入庫頭文件(重點)
#import <QuartzCore/QuartzCore.h>
///
設置圓形 cornerRadius 如果爲圓形
,則爲 寬或高的一半
imageView.layer.masksToBounds =YES;
CGFloat w = imageView.frame.size.width
/2;
imageView.layer.cornerRadius = w;
//邊框寬度及顏色設置
[imageView.layersetBorderWidth:2];
[imageView.layersetBorderColor:[[UIColorblueColor]CGColor]];
//圓角設置
imageView.layer.cornerRadius = 6;
imageView.layer.masksToBounds = YES;
//邊框寬度及顏色設置
[imageView.layer setBorderWidth:2];
[imageView.layer setBorderColor:[UIColor blueColor]]; //設置邊框爲藍色
//自動適應,保持圖片寬高比
imageView.contentMode = UIViewContentModeScaleAspectFit;