Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide UITextField border?

People also ask

How do I hide the border in TextField?

To hide the border when TextField is having an error: Inside the InputDecoration, add the errorBorder property and set it to InputBorder. none.

How to remove border of text field in swift?

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: enter image description here


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]];