3

My goal is to make my button look like this:

enter image description here

minus the black edges around the button.

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

layer.cornerRadius = 10.0

When I do that I get this:

enter image description here

It rounds the edges, but doesn't give me my desired goal.

Any suggestion?

Community
  • 1
  • 1
bradford gray
  • 507
  • 2
  • 5
  • 15

2 Answers2

16

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)

enter image description here

Confused
  • 5,839
  • 6
  • 26
  • 65
Rob
  • 2,531
  • 3
  • 24
  • 32
1

You Can do it like this (For Example if you button is called button):

button.layer.cornerRadius = button.bounds.size.height / 2.0
Mago Nicolas Palacios
  • 2,139
  • 12
  • 26