Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 752 Vote(s) - 3.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet

#11
I found that `disablesAutomaticKeyboardDismissal` and adding a `disablesAutomaticKeyboardDismissal` function didn't work for my `UITextField` in a modal dialog.

The onscreen keyboard just wouldn't go away.

My solution was to *disable* all text-input controls in my dialog, then re-enable the relevant ones a fraction of a second later.

It seems as though when iOS sees that none of the `UITextField` controls are enabled, then it *does* get rid of the keyboard.

Reply

#12
I solved this by using the `UIModalPresentationPageSheet` presentation style and resizing it immediately after I present it. Like so:

viewController.modalPresentationStyle = UIModalPresentationPageSheet;
viewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:viewController animated:YES];
viewController.view.superview.autoresizingMask =
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin;
viewController.view.superview.frame = CGRectMake(
viewController.view.superview.frame.origin.x,
viewController.view.superview.frame.origin.y,
540.0f,
529.0f
);
viewController.view.superview.center = self.view.center;
[viewController release];
Reply

#13
Swift 4.1:
extension UINavigationController {
override open var disablesAutomaticKeyboardDismissal: Bool {
return false
}
}
Reply

#14
In the view controller that is presented modally, just override `disablesAutomaticKeyboardDismissal` to return `NO`:

```objc
- (BOOL)disablesAutomaticKeyboardDismissal {
return NO;
}
```
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through