iOS 5中的键盘调整大小事件(中文键盘错误)? [英] Keyboard resize event in iOS 5 (Chinese keyboard bug)?

查看:158
本文介绍了iOS 5中的键盘调整大小事件(中文键盘错误)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从iOS 5开始,键盘现在可以是基于输入语言的可变高度。具体来说,中文现在包括键盘上方的自动完成部分,非常类似于您在Android中看到的部分。该自动完成部分增加了键盘的测量高度。

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.

当用户点击世界键时,是否可以订阅和/或接收有关键盘何时更改尺寸的通知?请注意,这与获取有关键盘的通知(keyboardWillShow)不同。在这种情况下,他们的键盘已经启动,它的尺寸只是因用户交互而改变。

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.

谢谢!

推荐答案

当输入法改变时,虽然键盘已经存在,iOS仍会发送通知UIKeyboardDidShowNotification,因此,注册此通知,并通过关键UIKeyboardFrameEndUserInfoKey通知中的userInfo获取位置和帧更改,然后您可以根据键盘大小重新布局您的元素。

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:

(英文)如何在iOS 5中输入中文时更改键盘框架

(中文)如何处理iOS 5中文输入法下键盘的框架尺寸变化

这篇关于iOS 5中的键盘调整大小事件(中文键盘错误)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆