1

在目标 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];
4

1 回答 1

7

您应该使用继承自的resignFirstResponder方法UIResponderUITextField

[tempTextField resignFirstResponder];
于 2009-07-10T03:57:27.357 回答