Modal Dialog Does Not Dismiss Keyboard
Overriding disablesAutomaticKeyboardDismissal
to return NO as below fixed the same problem of mine. You should put this code to your view controller, from which you initiate the keyboard:
- (BOOL)disablesAutomaticKeyboardDismissal {
return NO;
}
Also, check this SO question if you want to get a detailed explanation.
iPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet
In the view controller that is presented modally, just override disablesAutomaticKeyboardDismissal
to return NO
:
- (BOOL)disablesAutomaticKeyboardDismissal {
return NO;
}
How to dismiss keyboard in case of a modal view?
I read that dismissing the keyboard is not possible when presenting as FormSheet?
This is correct. If you'd like to dismiss the keyboard while showing a modal view, you'll have present it using a different modalStyle and you could resize the view to take the same frame as a formsheet.
Avoid modal dismiss on enter keypress
I just had this problem too.
My problem was that i had a close button in my modal
Pressing enter in the input field caused this button to be fired. I changed it to an anchor instead and it works as expected now (enter submits the form and does not close the modal).
×
Without seeing your source, I can't confirm that your cause is the same though.
UITextField's keyboard won't dismiss. No, really
Implement -disablesAutomaticKeyboardDismissal
and return NO. It does work on iOS 6, but you have to implement it in the right controller. If you have a modal form sheet navigation controller with a child controller that has text fields, it's the navigation controller that needs the method implementation, not the child.
(See also Dismiss keyboard on IPAD)
Related Topics
Converting Hex String to Nsdata in Swift
Why Is Glreadpixels() Failing in This Code in iOS 6.0
How to Modify Swift_Module_Name
Picking Two Different Images in the Same View Controller Using Imagepickercontroller in Swift
Uitextfield's Numerical Pad: Dot Instead of Comma for Float Values
Cgcontextdrawimage Draws Image Upside Down When Passed Uiimage.Cgimage
How to Change Height of Navigation Bar - Swift 3
Ios: How to Share Text and Image on Social Networks
How to Ignore Touch Events and Pass Them to Another Subview'S Uicontrol Objects
Arm64 Architecture in Xcode 5.1
Unexpectedly Found Nil Iboutlet in Prepareforsegue
How to Create a Guid/Uuid Using Ios
Xcode, Where to Assign the Segue Identifier
What Are Sprite Kit'S "Category Mask" and "Collision Mask"
Nsurlsession With Nsblockoperation and Queues
Uipageviewcontroller Gesture Recognizers
How to Add Objects to a Uiscrollview That Extend Beyond Uiview from Storyboard