Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a line in interface builder in Xcode 4

I'd like to draw a simple inset line in Interface Builder to separate some items in a list and make the UI a bit more tidy. I don't see any "line" or similar objects in the objects library and can't seem to find any drawing commands in Interface builder.

like image 677
Kongress Avatar asked Jun 06 '11 15:06

Kongress


People also ask

How do you draw a line in a storyboard?

You can also use a UILabel, simply set the constraints to the leading and trailing edges of the view controller, set the height to whatever size you want your line to be, set the text color to transparent and the background to the color you want the line to be, finally set the top constrain to the bottom of what you ...


2 Answers

I use a very narrow UIView with backgroundColor set to the appropriate color.

like image 83
Drew C Avatar answered Sep 24 '22 08:09

Drew C


There are no lines in the iPhone UI library. This functionality on Max OS X was supplied by NSBox, but on the iPhone there is no corresponding UI element.

like image 20
EJV Avatar answered Sep 23 '22 08:09

EJV