Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

As of iOS 5, the keyboard can now be a variable height based on the input language. Specifically the Chinese language now includes an autocomplete section above the keyboard, very similar to what you see in Android. That autocomplete section increases the measured height of the keyboard.

chinese keyboard

Is there an even to which one may subscribe and/or receive notifications about when the keyboard changes dimensions as a result of the user clicking the "world" key? Note that this is different from getting the notification about the keyboard coming up (keyboardWillShow). In this case, they keyboard is already up, it's dimensions are simply changing as a result of user interaction.

Thanks!

like image 927
esilver Avatar asked Jan 01 '26 05:01

esilver


1 Answers

When the input method changed, although the keyboard is already there, iOS will still send notification UIKeyboardDidShowNotification, so, register this notification, and get the location and frame change through the userInfo within notification with key UIKeyboardFrameEndUserInfoKey, then you can relayout your elements depend on the keyboard size.

more detail information, read this blog post:

(English) How to handle the keyboard frame change when input Chinese in iOS 5

(Chinese) 如何处理iOS 5中文输入法下keyboard的frame尺寸变化

like image 183
Wubao Li Avatar answered Jan 02 '26 18:01

Wubao Li