1.首先在TARGETS-Build Phases-Link Binary With Libraries 中导入QuartzCore.framework
2.在页面中
1 | #import <QuartzCore/QuartzCore.h> |
3.设置圆角
01 | subView.layer.masksToBounds = YES; |
02 |
03 | // 设置圆角角度 |
04 | subView.layer.cornerRadius = 6.0; |
05 |
06 | // 圆角描边线的宽度 |
07 | subView.layer.borderWidth = 0.5; |
08 |
09 | // 圆角描边线的颜色 |
10 | subView.layer.borderColor = [[UIColor whiteColor] CGColor]; |
完成