我正在显示操作表textFieldDidBeginEditing
,这是我的代码:
- (void)textFieldDidBeginEditing:(UITextField *)textField {
// dept_label is my UITextField property
if (textField == dept_label) {
[textField setUserInteractionEnabled:YES]; // i also used dept_label instead textfield here...
[textField resignFirstResponder];
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select"
delegate:self
cancelButtonTitle:@"OK"
destructiveButtonTitle:nil
otherButtonTitles:@"Manpower", @"Admin",@"Research" ,nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleDefault];
[actionSheet showInView:self.view];
}
}
问题是操作表被激活但键盘没有被隐藏!