高效设置UIimageView圆角
2016-09-23 本文已影响36人
莫寂岚
UIGraphicsBeginImageContextWithOptions(self.companyImg.bounds.size, NO, [UIScreen mainScreen].scale);
[[UIBezierPath bezierPathWithRoundedRect:self.companyImg.bounds cornerRadius:self.companyImg.bounds.size.width/2] addClip];
[image drawInRect:self.companyImg.bounds];
self.companyImg.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();