How to make a rounded oval button?

前端 未结 2 1377
暖寄归人
暖寄归人 2021-01-22 03:21

My goal is to make my button look like this:

minus the black edges around the button.

After reading quite a few posts, I see most solutions saying to use

2条回答
  •  灰色年华
    2021-01-22 04:18

    Swift 3

    myButton.layer.cornerRadius = myButton.frame.height / 2
    
    myButton.backgroundColor = UIColor.blue
    myButton.clipsToBounds = true
    myButton.tintColor = UIColor.white
    myButton.setTitle("Connect With Facebook", for: .normal)
    

提交回复
热议问题