How to create border in UIButton?

前端 未结 12 1515
天命终不由人
天命终不由人 2020-12-02 05:51

I use custom button in my app named \"addButton\" and I want to border it with white color how can i get the white color border around my custom button?

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 06:24

    To change button Radius, Color and Width I set like this:

    self.myBtn.layer.cornerRadius = 10;
    self.myBtn.layer.borderWidth = 1;
    self.myBtn.layer.borderColor =[UIColor colorWithRed:189.0/255.0f green:189.0/255.0f blue:189.0/255.0f alpha:1.0].CGColor;
    

提交回复
热议问题