0

当我们在此使用 UIModalPresentationFormSheet 时如何隐藏键盘当我单击键盘完成按钮时我的键盘没有从模型视图中隐藏此代码中的问题我以错误的方式调用此类

-(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];

}
4

2 回答 2

1

单击完成按钮时,您应该隐藏键盘。

- (IBAction)done
{
    [self.textField resignFirstResponder];
    ...
}
于 2012-08-20T09:09:44.747 回答
0

只需这样做:

[self.view endEditing:YES];
于 2012-08-20T07:03:00.323 回答