开发者

iphone Development - UITextField - Display (X) on the right [duplicate]

Th开发者_Python百科is question already has answers here: Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜