问题描述
我在IOS 7和IOS 8设备上运行相同的代码,结果却不同
I am running the same code on an IOS 7 and IOS 8 device with differing results
给出一个带有两个文本字段的屏幕
Given a screen with two text fields
在IOS 7中,如果我触摸第一个字段,则会调用WillShow,但是如果已经显示键盘时触摸第二个字段,则不会再次调用
In IOS 7 if I touch the first field keyboardWillShow is called but if I touch the second field when the keyboard is already shown it is not called a second times.
在IOS 8中,键盘两次将WillShow调用
In IOS 8 keyboardWillShow is called twice
这是有据可查的行为吗?
Is this documented behaviour ?
推荐答案
原因是键盘有所不同.如果第二个字段是密码字段,则表示引擎盖下还有另一个键盘.因此,通知将发送两次.
The reason is the difference in the keyboard. If the second field is a password field this means there is another keyboard under the hood. Therefore the notification is sent twice.
这篇关于IOS8中带有UIKeyboardWillShowNotification的keyboardWillShow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!