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

You should hide the keyboard when the done button is clicked.

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

これを行うだけです:

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