yogsma
yogsma

Reputation: 10594

How to show border of a button in storyboard

I am creating user interface for app in storyboard, but I can not find where I can set the border for a button to be visible in storyboard. How do I set the border of a button?

Upvotes: 2

Views: 3269

Answers (2)

liushuaikobe
liushuaikobe

Reputation: 2190

If you just want to visualize the button, you could check this after setting the constraints of the Button:

update thet frame

Or, by setting the style of the UIButton:

set the style of the UIButton

If none of above meet your requirements, you have to set the border of the button in the code:

@IBOutlet weak var myButton: UIButton!

myButton.layer.borderWidth = 1.0
myButton.layer.borderColor = UIColor.redColor().CGColor

Upvotes: 1

tounaobun
tounaobun

Reputation: 14857

Select Xcode -> Open Editor menu -> Canvas -> Show Bounds Rectangles

enter image description here

Note that all views will have borders and only be visible in storyboard(design time).

Upvotes: 9

Related Questions