判断 iPhone 虚拟键盘是否打开的代码
2013-01-10 13:48
267 查看
CocoaChina 会员“qqn_pipi”分享的判断 iPhone 虚拟键盘是否打开的代码,原理很简单:看当前的窗口是否存在一个 responder,从而判别 iPhone 的键盘是否打开了。
BOOL TTIsKeyboardVisible() {
// Operates on the assumption that the keyboard is visible if and only if there is a first
// responder; i.e. a control responding to key events
UIWindow* window = [UIApplication sharedApplication].keyWindow;
return !![window findFirstResponder];
}
BOOL TTIsKeyboardVisible() {
// Operates on the assumption that the keyboard is visible if and only if there is a first
// responder; i.e. a control responding to key events
UIWindow* window = [UIApplication sharedApplication].keyWindow;
return !![window findFirstResponder];
}
相关文章推荐
- 判断 iPhone 虚拟键盘是否打开的代码
- 判断 iPhone 虚拟键盘是否打开的代码 (转)
- python判断端口是否打开的实现代码
- [JS代码]如何判断ipad或者iphone是否为横屏或者竖屏 - portrait或者lan...
- 简单判断是否是微信打开页面代码
- 判断用户设备是否是 iPhone 4 Retina 屏的代码
- [JS代码]如何判断ipad或者iphone是否为横屏或者竖屏 - portrait或者landscape
- 判断用户设备是否是 iPhone 4 Retina 屏的代码
- iPhone开发之判断用户输入的邮箱地址是否合法的代码
- 判断iPhone的WiFi是否打开的两种方法
- [FAQ04776]各个版本如何判断是否打开adb端口【google原生代码】
- 分享一段js,判断是否是在iPhone中的Safari浏览器打开的页面
- 判断iPhone的WiFi是否打开的两种方法 之是否连接上 WiFi
- sas 判断数据集是否存在及如何用sas代码关闭已打开的数据集
- PHP判断端口是否打开的代码
- 判断iPhone的WiFi是否打开
- 判断是否微信 IPhone 打开
- 判断用户设备是否是 iPhone 4 Retina 屏的代码
- [JS代码]如何判断ipad或者iphone是否为横屏或者竖屏 - portrait或者landscape
- python判断端口是否打开的实现代码