Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 526
user1354603 Avatar asked Oct 03 '13 11:10

user1354603


Video Answer


1 Answers

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.

like image 191
Ayush Avatar answered Sep 18 '22 11:09

Ayush