5

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.

user1354603
  • 4,034
  • 4
  • 31
  • 43

1 Answers1

5

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.

Ayush
  • 3,989
  • 1
  • 26
  • 34
  • That works, but I found this solution to be more elegant: http://stackoverflow.com/questions/7666863/uiview-bottom-border – user1354603 Oct 03 '13 at 11:14
  • 1
    It was just a tweak. though you can use `` which I feel it is much faster than `UIKit`. – Ayush Oct 03 '13 at 11:22