图片圆角显示

首先加入头文件#import <QuartzCore/QuartzCore.h>,并载入CoreGraphics.framework框架。

 

self = [super initWithNibName:@"testViewController" bundle:nil];
if (self) {
   UIImageView *headerImage = self.image;		
   CALayer *layer = [headerImage layer];
   [layer setMasksToBounds:YES];
   [layer setCornerRadius:5.0];
   [layer setBorderWidth:1.0];
   [layer setBorderColor:[[UIColor redColor] CGColor]];
}

你可能感兴趣的:(ios,iPhone)