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.
这篇关于检查拆分键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:检查拆分键盘
基础教程推荐
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01