user1354603
user1354603

Reputation: 4032

How to set an upper border/separator line in ios?

I have an imageview and a label, I want a border in between them, what is the best approach?

I know that the following code creates a border around the whole imageView:

[imageView.layer setBorderColor: [[UIColor blackColor] CGColor]];
[imageView.layer setBorderWidth: 2.0];

But I only want a line below it, not around the whole thing.

Upvotes: 5

Views: 6273

Answers (1)

Ayush
Ayush

Reputation: 3999

Just add an UILabel with background color as black(Assuming your border color as black) and height of 1px between you UIImageView and UILabel this would be much simpler.

Upvotes: 5

Related Questions