Note that there are some explanatory texts on larger screens.

plurals
  1. POiPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet
    primarykey
    data
    text
    <p><strong>Note:</strong> </p> <p>See accepted answer (not top voted one) for solution as of iOS 4.3.</p> <p>This <strong>question</strong> is about a behavior discovered in the iPad keyboard, where it refuses to be dismissed if shown in a modal dialog with a navigation controller. </p> <p>Basically, if I present the navigation controller with the following line as below:</p> <pre><code>navigationController.modalPresentationStyle = UIModalPresentationFormSheet; </code></pre> <p>The keyboard refuses to be dismissed. If I comment out this line, the keyboard goes away fine. </p> <p>...</p> <p>I've got two textFields, username and password; username has a Next button and password has a Done button. The keyboard won't go away if I present this in a modal navigation controller.</p> <p><strong>WORKS</strong></p> <pre><code>broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; [self.view addSubview:b.view]; </code></pre> <p><strong>DOES NOT WORK</strong></p> <pre><code>broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:b]; navigationController.modalPresentationStyle = UIModalPresentationFormSheet; navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; [b release]; </code></pre> <p>If I remove the navigation controller part and present 'b' as a modal view controller by itself, it works. Is the navigation controller the problem?</p> <p><strong>WORKS</strong></p> <pre><code>broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; b.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:b animated:YES]; [b release]; </code></pre> <p><strong>WORKS</strong></p> <pre><code>broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:b]; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; [b release]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload