1 keyboard objective-c uitextfield
在目标c中使用UITextField时,会出现键盘,键入一些图形后,我想移动到另一个文本字段或按钮,但光标从文本字段中移除,键盘也不会消失.我应该怎么做?
tempTextField.borderStyle = UITextBorderStyleBezel;
tempTextField.textColor = [UIColor blackColor];
tempTextField.font = [UIFont systemFontOfSize:17.0];
tempTextField.placeholder = @"";
tempTextField.backgroundColor = [UIColor blueColor];
tempTextField.autocorrectionType = UITextAutocorrectionTypeNo;
tempTextField.keyboardType = UIKeyboardTypeDefault;
tempTextField.returnKeyType = UIReturnKeyDone;
tempTextField.clearButtonMode = UITextFieldViewModeNever;
tempTextField.clearButtonMode = UITextFieldViewModeNever;
[ tempTextField setEnabled: YES ];
self.txtAirportName = tempTextField;
txtAirportName.delegate = self;
[tempTextField release];
Run Code Online (Sandbox Code Playgroud)
您应该使用resignFirstResponder的方法UIResponder,它UITextField继承自:
[tempTextField resignFirstResponder];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1672 次 |
| 最近记录: |