1.使用xib
在User Defined Runtime Attributes點擊+
Key Path ? ? ? ? ? ? ? ? ? ? ?Type ? ? ? ? ? ? ? ? Value
layercorderRadius ? ? ?Nsbumber ? ? ? ? ? ?5
2.使用代碼
//1.設置邊框顏色
_view.layer.borderColor= [UIColorlightGrayColor].CGColor;
//2.設置邊框的寬度
_view.layer.borderWidth=2;