0

I want to make visible just bottom border of TextView. How can I do it?

Can I make visible just bottom side of the textView or there are another method?

Orkhan Alizade
  • 7,379
  • 14
  • 40
  • 79

1 Answers1

1

You can add layer for your aim, but I'm not sure that is right way.

+ (void)addBottomBorderToView: (UIView * ) view WithColor:(UIColor *)color andWidth:(CGFloat) borderWidth
{
    CALayer * bottomBorder = [CALayer layer];
    bottomBorder.borderColor = color.CGColor;
    bottomBorder.borderWidth = borderWidth;
    bottomBorder.frame = CGRectMake(0, view.frame.size.height - borderWidth, view.frame.size.width, borderWidth);
    [view.layer addSublayer:bottomBorder];
}
Tikhonov Aleksandr
  • 13,945
  • 6
  • 39
  • 53