iOS noob here
When I add a default UITextField
to the ViewController, it looks like this:
My designer would like me to make the UITextField
look like this (i.e. background is transparent, and just has an underline:
How do I do this? Should be asking my designer for an image to set as background for the UITextField
. What should the image look like? Should the image be = the blue background + the underline (minus the number i guess)
Is that right?
UPDATE: Based on direction below (from @Ashish Kakkad), added this code in Swift to ViewDidLoad:
var bottomLine = CALayer()
bottomLine.frame = CGRectMake(0.0, view.frame.height - 1, view.frame.width, 1.0)
bottomLine.backgroundColor = UIColor.whiteColor().CGColor
tf_editPassword.borderStyle = UITextBorderStyle.None
tf_editPassword.layer.addSublayer(bottomLine)
This almost works, but the problem is that all side borders disappear, I want just the bottom line to stay.
UITextBorderStyle.None
removes all borders, would like to keep the bottom line – Freiburg