我正在使用UITextField的becomeFirstResponder方法来显示键盘。这在iOS 7中有效。但是在iOS 8中,该方法不能显示键盘。
UITextField *txtAddNew = [[UITextField alloc] initWithFrame:CGRectMake(10,10,240, 21)];
txtAddNew.font = [UIFont fontWithName:@"Helvetica" size:16];
txtAddNew.clearButtonMode = UITextFieldViewModeWhileEditing;
txtAddNew.returnKeyType = UIReturnKeyDone;
txtAddNew.delegate = self;
txtAddNew.autocorrectionType = UITextAutocorrectionTypeNo;
txtAddNew.tag = 15;
// Open keyboard
[txtAddNew becomeFirstResponder];
有没有办法在iOS 8中实现这个?