//UIButtonTypeRoundedRect 四个角是圆弧形状
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
//设置圆角
[button.layer setMasksToBounds:YES];
[button.layer setCornerRadius:20.0];
//设置边框的宽度(1.0的效果就很不错了)
[button.layer setBorderWidth:1.0];