Reputation: 5645
I added bottom border to UITextField this way:
let bottomLine = CALayer()
bottomLine.frame = CGRectMake(0.0, self.frame.height, self.frame.width, CGFloat(borderWidth))
bottomLine.backgroundColor = borderColor.CGColor
self.borderStyle = UITextBorderStyle.None
self.layer.addSublayer(bottomLine)
And I am getting this:
I would like move border down. To do this I am setting border frame this way:
bottomLine.frame = CGRectMake(0.0, self.frame.height + 5, self.frame.width, CGFloat(borderWidth))
Here I am increasing it by 5px. But it moves beyond the text field's frame. But I cannot adjust UITextField
's height:
If I am setting it programmatically, application hangs on refreshing designables (I am using IBDesignable
subclass of UITextField
).
Upvotes: 0
Views: 235