Keyboard resize event in iOS 5 (Chinese keyboard error)?

Starting with iOS 5, the keyboard can now be of variable height based on the input language. In particular, the Chinese language now includes an autocomplete section above the keyboard, very similar to what you see on Android. This autocomplete section increases the measured height of the keyboard.

chinese keyboard

Is there even one that you can subscribe to and / or receive notifications about when the keyboard changes size as a result of the user pressing the "world" key? Note that this is different from receiving notification of an approaching keyboard (keyboardWillShow). In this case, the keyboard is already inserted, the dimensions simply change as a result of user interaction.

Thanks!

+3
source share
1 answer

When the input method has changed, although the keyboard already exists, iOS will still send a UIKeyboardDidShowNotification notification, so register this notification and get the location and frame change via userInfo in the notification using the UIKeyboardFrameEndUserInfoKey key, then you can transfer your elements depending on the size of the keyboard.

read more in this blog post:

(in English) How to handle keyboard changes when entering Chinese in iOS 5

(Chinese) 如何 倄理 iOS 5 δΈ­ζ–‡ θΎ“ε…₯ 法 δΈ‹ keyboard ηš„ frame ε°Ίε―Έ ε˜εŒ–

+6
source

Source: https://habr.com/ru/post/1487049/


All Articles