iphone Development - UITextField - Display (X) on the right [duplicate]
Possible Duplicate:
Adding the “Clear” Button to an iPhone UITextField
hey there, i created a UITextField and i want to add an (X) -CLEAR- button to the right of it. The regular button that clears what is already written in the textfield. Thanks.
set the clearButtonMode
field.clearButtonMode = UITextFieldViewModeAlways;
field.clearButtonMode = UITextFieldViewModeNever;
field.clearButtonMode = UITextFieldViewModeUnlessEditing;
field.clearButtonMode = UITextFieldViewModeWhileEditing;
or use Interface Builder, it has a setting for the clear button as well.
Set the text field's clearButtonMode
. See here.
精彩评论