//准备工作
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(50,50,100,40);
button.backgroundColor = [UIColor blueColor];
//关键语句
button.layer.cornerRadius = 2.0;//2.0是圆角的弧度,根据需求自己更改
button.layer.borderColor = [UIColor blackColor];//设置边框颜色
button.layer.borderWidth = 1.0f;//设置边框颜色

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-23
  • 2021-10-11
  • 2021-11-16
  • 2021-08-10
猜你喜欢
  • 2021-09-05
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
  • 2022-12-23
相关资源
相似解决方案