[box.actionButton.layer setMasksToBounds:YES];
[box.actionButton.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
//边框宽度
[box.actionButton.layer setBorderWidth:1.0];
//设置边框颜色有两种方法:第一种如下:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 0, 0, 0, 1 });
[box.actionButton.layer setBorderColor:colorref];//边框颜色
//第二种方法如下:
//_testButton.layer.borderColor=[UIColor grayColor].CGColor;
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/5144.html