vinothp
vinothp

Reputation: 10069

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?

Upvotes: 17

Views: 19089

Answers (3)

Kuei
Kuei

Reputation: 61

Use "View" and set its height as 1 or any size you want, and change the background color.

Upvotes: 6

bitmapdata.com
bitmapdata.com

Reputation: 9600

In Storyboard, if you don't want code. I recommend following process.

  1. draw a line using a drawing tool (about illustrator, photoshop) and then saved as png.

  2. make a UIImageView your Storyboard and set image your png file.

Upvotes: 5

Tom
Tom

Reputation: 1349

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

Upvotes: 19

Related Questions