[box.actionButton.layersetMasksToBounds:YES];[box.actionButton.layersetCornerRadius:10.0];//设置矩形四个圆角半径//边框宽度[box.actionButton.layersetBorderWidth:1.0];//设置边框颜色有两种方法:第一种如下:CGColorSpaceRefcolorSpace=CGColorSpaceCreateDeviceRGB();CGColorRefcolorref=CGColorCreate(colorSpace,(CGFloat[]){0,0,0,1});[box.actionButton.layersetBorderColor:colorref];//边框颜色//第二种方法如下://_testButton.layer.borderColor=[UIColorgrayColor].CGColor;