To hide the border when TextField is having an error: Inside the InputDecoration, add the errorBorder property and set it to InputBorder. none.
You should be able to remove the border just with textField. borderStyle = UITextBorderStyle. None.
If you want to remove the textfield border you can do it directly with interface builder:
Just use this..
textOption.borderStyle = UITextBorderStyleNone;
[textOption setBackgroundColor:[UIColor clearColor]];
Swift 4 and 5 :
yourTextfield.borderStyle = .none
In Swift this worked for me :
passwordTextField.borderStyle = UITextBorderStyle.none
If you are using Interface Builder or Storyboard, you can select the textField, go on the Attributes inspector's tab, under the option Border Style you have 4 styles to chose from, the first one is without border.
If doing it in code, this should work
textOption.borderStyle = UITextBorderStyleNone;
[textOption setBackgroundColor:[UIColor clearColor]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With