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?
Asked
Active
Viewed 3,200 times
2
-
possible duplicate of [Set UIButton Layer Border Width and Color in Interface Builder](http://stackoverflow.com/questions/26161429/set-uibutton-layer-border-width-and-color-in-interface-builder) – picciano May 16 '15 at 02:47
2 Answers
9
Select Xcode -> Open Editor menu -> Canvas -> Show Bounds Rectangles
Note that all views will have borders and only be visible in storyboard(design time).

tounaobun
- 14,570
- 9
- 53
- 75
1
If you just want to visualize the button, you could check this after setting the constraints of the Button:
Or, by setting 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

liushuaikobe
- 2,152
- 1
- 23
- 26