在目标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];
答案 0 :(得分:7)
您应该使用UIResponder
的{{3}}方法,resignFirstResponder
继承自:{/ p>
[tempTextField resignFirstResponder];