I'm having a strange issue with my modal view. The modal view asks for some user input so the keyboard pops on. When I click the cancel button to dismiss while the keyboard is still active they both dismiss in an animated fashion but the modal jerks to the right first, very strange. What would be my best course of action here? Would it be to disable my cancel modal button when the keyboard is active? If so how do I go about detecting the presents of the keyboard?
Thanks!
You can detect the presence of keyboard using NSNotification Class. Hope this helps
Related
iPhone app.
I have a simple view with UITextView as first responder. I resign first responder and pop to the previous controller but the keyboard stays. Textview doesn't even exist anymore but the keyboard is still visible.
The controller that I pop to is a tableview, no objects that can even assume first responder status. So the keyboard is just there obscuring half my table and there is not even a way to dismiss it. I have to navigate back to a view that has a text box or textview, select one and dismiss that in order to get rid of the keyboard.
How is this possible?
On viewWillAppear just write
[self.view endEditing:YES];
I have a UITextView with an inputAccessoryView that contains a toolbar with a "Done" button so that the user can end the editing process. Inside the method fired by pressing the Done button, I call resignFirstResponder on the UITextView to dismiss the keyboard.
So when I tap "Done", the accessory view disappears, but the keyboard itself remains. I am completely stumped as to why this might be happening, or where to start looking. This app is running on iPad with iOS 5.1
Any ideas?
Thanks! //Scott
In a Modal view controller, I'm trying to display a standard keyboard. But It's not animating. In this view, I dismiss and invoke the keyboard. But when I invoked it, there is no animation and It's just appear. (and when I dismiss the keyboard, it just slides down normally).
Any idea, why is this happening ?
I have a Modal View Controller presented as a Form Sheet in Landscape on an iPad. When I dismiss the view, the view jumps to a different location, as in this thread:
A modal VC with a keyboard on landscape changes location when dismissed:
Modal View Controller with keyboard on landscape iPad changes location when dismissed
The response to that thread is to call resignFirstResponder, however, you are not allowed to dismiss keyboards when using a Form or Page Sheet:
Modal Dialog Does Not Dismiss Keyboard
Has any one else had this problem? Is there a way to either force the keyboard to be dismissed or force the view into a nice position when it's being animated away?
Cheers,
Nick.
The keyboard will be removed only after the modal form is dismissed. Apple has the idea that if you are using modal form, then you'll need the keyboard for multiple fields therefore it shouldn't be removed.
I recently discovered that if a UITextField is being edited in a controller that's attached to a UINavigationController and the back button is pressed, upon returning to this controller, the DidBeginEditing function is called again and the UITextField keyboard is brought back up. I was wondering if there's a way to stop the keyboard from coming back up. Maybe there's a way to hook the back button so it doesn't save the fact that the text field is being edited.
Implement viewWillDisappear: on the view controller that controls the text field, and call:
[theTextField resignFirstResponder];
This will dismiss the keyboard.