IOS8中带有UIKeyboardWillShowNotification的keyboardWillShow [英] keyboardWillShow in IOS8 with UIKeyboardWillShowNotification

查看:76
本文介绍了IOS8中带有UIKeyboardWillShowNotification的keyboardWillShow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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