Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a horizontal line in iOS using StoryBoard?

In my app I am trying to create a customized/stylish horizontal line in-between two labels. I have searched in SO and Google but it has only by code. How to add a horizontal line using story board?

In Android I have designed the below line using XML.

enter image description here

How can I create the same line in iOS?

like image 420
vinothp Avatar asked Aug 12 '12 07:08

vinothp


People also ask

How do you add a line in Storyboard?

In Storyboard, if you don't want code. I recommend following process. draw a line using a drawing tool (about illustrator, photoshop) and then saved as png. make a UIImageView your Storyboard and set image your png file.

How do I add a separator line in Swift?

All you have to do is drag a UIView with height = 1 and width whatever is good for you (ideally equal to screen width). Place it where you want the lines to be. works.


Video Answer


1 Answers

You just have 2 options:

  • take an image with the appropriate gradient and insert an image view
  • make yourself a view class, that fills it's view with a gradient (by code)

That's it

like image 173
Tom Avatar answered Oct 10 '22 15:10

Tom