当我在这里使用UIModalPresentationFormSheet时如何隐藏键盘当我点击键盘完成按钮时我的键盘没有从modelview中隐藏这个代码中的问题我在这个类中调用了一些错误的方法
-(IBAction)BenefitManage
{
manage*theManageView=[[[manage alloc]initWithNibName:@"manage" bundle:nil]autorelease];
[theManageView setDelegate:self];
theManageView.navigationItem.title =NSLocalizedString(@"Manage", @"Manage");
navController = [[UINavigationController alloc] initWithRootViewController: theManageView];
navController.modalPresentationStyle=UIModalPresentationFormSheet;
//theManageView.modalPresentationStyle = UIModalPresentationFormSheet;
// [self presentModalViewController:theManageView animated:NO];
[self presentModalViewController:navController animated:YES];
}
答案 0 :(得分:1)
单击完成按钮时应隐藏键盘。
- (IBAction)done
{
[self.textField resignFirstResponder];
...
}
答案 1 :(得分:0)
这样做:
[self.view endEditing:YES];