UIButton *button = [UIButton alloc] initWithFrame:CGRect(100, 100, 100 , 100)];
//设置边框颜色
button.layer.borderColor = [[UIColor redColor] CGColor];
//设置边框宽度
button.layer.borderWidth = 1.0f;
//给按钮设置角的弧度
button.layer.cornerRadius = 4.0f;
xib 中 layer.cornerRadius
//设置背景颜色
button.backgroundColor = [UIColor redColor];
button.layer.masksToBounds = YES;