How can I interact with the iPad keyboard hide key?

In the lower right corner of the iPad-keyboard there is a button that should hide the keyboard.

enter image description here

How can I interact with it programmatically? (get the button, then send it UIControlEventTouchUpInside ).

Does anyone know this?

[Edit] In my case, the keyboard is displayed in modal form.

+7
source share
3 answers

Overriding disablesAutomaticKeyboardDismissal to return NO , as shown below, allows you to cancel the keyboard when you resignFirstResponder , even if your UITextView is in view mode. You must put this code in your view controller from where you initiate the keyboard:

 - (BOOL)disablesAutomaticKeyboardDismissal { return NO; } 

Source: stack overflow

+2
source

Something like that? I can’t remember where I found this code, but I used it to switch the on-screen keyboard because it would be hidden by default if bluetooth was connected.

 - (void) toggleKeyboard(UIKeyboardImpl * keyImpl){ if (UIKeyboardAutomaticIsOnScreen()) { UIKeyboardOrderOutAutomatic(); } else { UIKeyboardOrderInAutomatic(); } 

Edit


I found where I have this code. It works fine, but to catch that you need to import the private GraphicsServices infrastructure, which is likely to cause your application to stray from the app store.

+1
source

In general, you should send a resignFirsResponder message to the active input view.

+1
source

All Articles