UIbutton 圆角和边线

#define WhiteColor [UIColor whiteColor]
#define YellowColor  Color_RGB(253,131,42,1)//主题黄
#define Font(a)     [UIFont systemFontOfSize:a * kWidth];

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.layer.cornerRadius = 63.5;  // 圆角的弧度  数值是高宽的一半  为圆形
    button.layer.borderWidth = 5;    //边线宽度
    button.layer.borderColor = WhiteColor.CGColor;      // 使用.CGColor  边线颜色
    button.titleLabel.font = Font(25.0);     
    [button setTitle:@"测 试" forState:UIControlStateNormal];
    button.backgroundColor = YellowColor;
    [button setTitleColor:WhiteColor forState:UIControlStateNormal];
 
    [self.view addSubview:button];

原文地址:https://www.cnblogs.com/sayimba/p/5653577.html