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]; |
完成