carloabelli
carloabelli

Reputation: 4349

UITextField Clear Button Does Not Show

I want to show a clear button always in a UITextField. I have tried to both set this in .xib Interface Builder: enter image description here and in code using this line: [_firstNameField setClearButtonMode:UITextFieldViewModeAlways];

Neither causes the button to show. Help please.

Upvotes: 6

Views: 2733

Answers (1)

LuisCien
LuisCien

Reputation: 6432

When you set it to UITextFieldViewModeAlways the clear button appears as long as there is text on the UITextField.

Hope this helps!

Upvotes: 15

Related Questions