方法一:代码直接控制
/** 设置圆角及边框 */
self.setButton.layer.masksToBounds = YES;
self.setButton.layer.cornerRadius = 4.0f;
self.setButton.layer.borderWidth = 1.0f;
self.setButton.layer.borderColor = [UIColor lightGrayColor].CGColor;
方法二:xib中设置(直接上图)
填写的几个属性值为:
layer.masksToBounds
layer.cornerRadius
layer.borderWidth
layer.borderColorFromUIColor