Check for split keyboard(检查拆分键盘)
问题描述
正如许多人所知,iOS 5 引入了用于拇指打字的灵巧拆分键盘.不幸的是,我有一些 UI 依赖于正常的全屏键盘布局.我的一个视图控制器向用户提供了一个文本输入表,如果他们单击一个将被键盘覆盖的文本字段,它会与键盘一起向上滑动.拆分键盘不需要此操作.
As many of you know iOS 5 introduced a slick split keyboard for thumb-typing. Unfortunately, I have some UI that is dependent on the normal full-screen keyboard layout. One of my view controllers presents the user with a text entry sheet, and if they click into a textField that would be covered by the keyboard, it slides up along with the keyboard. This action is unnecessary with the split keyboard.
有没有办法在弹出之前检查正在使用的键盘布局?
Is there a way to check which keyboard layout is in use before it pops up?
谢谢!
推荐答案
当键盘停靠时,UIKeyboardWillShowNotification 会被提升.如果键盘被拆分或取消停靠,则不会发出键盘通知.
When the keyboard is docked, UIKeyboardWillShowNotification will be raised. If the keyboard is split or undocked, no keyboard notifications are raised.
如果键盘停靠,UIKeyboardWillShowNotification 将被提升,以下情况为真:
If a keyboard is docked, UIKeyboardWillShowNotification will be raised, and the following will be true:
[[[notification userInfo] valueForKey:@"UIKeyboardFrameChangedByUserInteraction"] intValue] == 1
如果键盘未停靠,UIKeyboardWillHideNotification 将被引发,上述语句也将成立.
If a keyboard is undocked, UIKeyboardWillHideNotification will be raised, and the above statement will also be true.
使用这些信息对我的用户界面进行编码已经足够了.
Using this information has been adequate for me to code my user interface.
注意:这可能违反了 Apple 的指导方针,我不确定.
Note: this might be a violation of Apple's guidelines, I'm not sure.
这篇关于检查拆分键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:检查拆分键盘
基础教程推荐
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
