
邊框弧度
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 200)];
view.backgroundColor = [UIColor grayColor];
//取出view的層
CALayer *layer = [view layer];
//設(shè)置層的弧度是10
layer.cornerRadius = 10;
//剪切掉多余的陰影
layer.masksToBounds = YES;
//設(shè)置層的邊框的寬度為3
layer.borderWidth = 3;
//設(shè)置層的邊框的顏色為紅色,顏色轉(zhuǎn)換成CGColor
layer.borderColor = [[UIColor redColor] CGColor];
[self.view addSubview:view];