[Button.layer setMasksToBounds:YES];
[Button.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
//边框宽度
[Button.layer setBorderWidth:1.0];
//设置边框颜色有两种方法:第一种如下:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 0, 0, 0, 1 });
[Button.layer setBorderColor:colorref];//边框颜色
//第二种方法如下:
//Button.layer.borderColor=[UIColor grayColor].CGColor;
[Button.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
//边框宽度
[Button.layer setBorderWidth:1.0];
//设置边框颜色有两种方法:第一种如下:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 0, 0, 0, 1 });
[Button.layer setBorderColor:colorref];//边框颜色
//第二种方法如下:
//Button.layer.borderColor=[UIColor grayColor].CGColor;