键盘高度
来源:互联网 发布:华讯网络系统有限公司 编辑:程序博客网 时间:2024/05/17 09:12
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
//UIKeyboardWillShowNotification键盘出现
[defaultCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
//UIKeyboardWillHideNotification 键盘隐藏
[defaultCenter addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
- (void)keyboardWillShow:(NSNotification *)aNotification
{
//获取键盘的高度
NSDictionary *userInfo = [aNotification userInfo];
NSValue *aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
CGRect keyboardRect = [aValue CGRectValue];
int height = keyboardRect.size.width;
}
//UIKeyboardWillShowNotification键盘出现
[defaultCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
//UIKeyboardWillHideNotification 键盘隐藏
[defaultCenter addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
- (void)keyboardWillShow:(NSNotification *)aNotification
{
//获取键盘的高度
NSDictionary *userInfo = [aNotification userInfo];
NSValue *aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
CGRect keyboardRect = [aValue CGRectValue];
int height = keyboardRect.size.width;
}
0 0
- 键盘高度
- 键盘高度
- 键盘高度
- 监视键盘高度
- ios键盘高度
- 获取键盘的高度
- 计算键盘高度
- ios 键盘高度
- ios 获取键盘高度
- andorid 获取键盘高度
- ios自定义键盘高度
- 获取键盘高度
- 获取键盘高度
- 键盘自适应高度
- ios监视键盘高度
- iOS获取键盘高度
- 通知,获取键盘高度
- iphone键盘高度
- Tomcat登录Manager显示403 Access Denied
- vc++信号量同步机制例子
- [LeetCode]Flatten Binary Tree to Linked List
- 多个依赖Netty3的应用在同一个Wildfly服务器上的布署冲突问题分析与解决
- python cookbook(1)
- 键盘高度
- STL模版的优缺点
- MySQL根据某一Date值获取相关时间(前一天,后一天等)
- hihocoder #1110 正则表达式
- ssh+extjs项目代码
- 解决锐捷客户端间歇性出现密码不匹配,但是密码明明正确的问题
- [乐意黎原创] 红米1刷MIUI 6 系统
- Java 动态代理
- C++实现GUID