Ben*_*ins 4 iphone cocoa-touch objective-c uikit ios
我正在创建一个textField并将其添加到这样的视图中:
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(/*blah blah */)];
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.clearButtonMode = UITextFieldViewModeAlways;
[otherView addSubview:textField];
文本字段按预期otherView呈现,但无论我分配给clearButton的值是什么,都不会呈现clear按钮.有谁知道这可能导致什么?
答案是UITextField.clearButtonMode有效的.当文本字段有值时,按钮就在那里.我想我认为"总是"意味着"永远",当它真正意味着"何时.text != nil".
| 归档时间: | 
 | 
| 查看次数: | 3129 次 | 
| 最近记录: |