监控键盘出现和消失,获取键盘高度
2017-01-13 15:56
351 查看
//注册键盘出现的通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardWillShowNotification object:nil]; //注册键盘消失的通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotification object:nil]; - (void)keyboardWasShown:(NSNotification*)aNotification { //键盘高度 CGRect keyBoardFrame = [[[aNotification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; } -(void)keyboardWillBeHidden:(NSNotification*)aNotification { }
相关文章推荐
- 用通知监听键盘的出现与消失,与获取键盘高度
- iOS获取键盘的高度(在键盘出现,改变和消失时通知改变)
- iOS 键盘显示或消失的监听,获取键盘高度
- view的frame高度根据键盘出现、消失改变
- 简单的监听键盘出现和消失的方法以及得到键盘高度
- 获取iphone键盘的高度
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- jquery获取获取this出错、与键盘事件结合使用出现问题
- Android 获取控件高度宽度三种方法,防止0的出现~~~~赞
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- ios开发 动态获取中英文键盘高度
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度。判断出现滚动条
- Android系统获取键盘的高度。
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- 如何获取键盘的高度,而不需要通过通知?
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)
- 获取键盘高度的实现