键盘大小改变的消息
来源:互联网 发布:淘宝异地发货违规吗 编辑:程序博客网 时间:2024/05/22 15:30
在你的程序中加入监听[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
切换输入法的时候会调用keyboardWillShow方法,用下面的方法就能取得输入键盘的高度(仔细看看API):
- (void)keyboardWillShow:(id)sender {
CGRect keyboardFrame;
[[[((NSNotification *)sender) userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] getValue:&keyboardFrame];
keyboardHeight = CGRectGetHeight(keyboardFrame);
}
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
切换输入法的时候会调用keyboardWillShow方法,用下面的方法就能取得输入键盘的高度(仔细看看API):
- (void)keyboardWillShow:(id)sender {
CGRect keyboardFrame;
[[[((NSNotification *)sender) userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] getValue:&keyboardFrame];
keyboardHeight = CGRectGetHeight(keyboardFrame);
}
- 键盘大小改变的消息
- 窗口移动、改变大小的有关消息
- WM_SIZE 改变窗口大小 消息
- 控件大小改变消息 WM_SIZE
- 改变键盘的颜色
- 改变键盘的颜色
- 改变键盘的颜色
- 改变键盘的颜色
- 改变键盘的颜色
- 改变键盘的颜色
- MFC_OnSize_改变窗口大小(WM_SIZE消息映射)
- 改变层的大小
- 改变QMessageBox的大小
- 改变图像的大小
- 改变图片的大小
- 改变vdi的大小
- 改变AlertDialog 的大小
- 改变模态弹窗的大小
- hdu 3071 Gcd & Lcm game
- C# Tips: How to tell if system is little endian or big endian?
- Vector和ArrayList,LinkedList,Hashtable,HashMap的区别
- 使用 dom4j 解析 XML
- 改变键盘颜色
- 键盘大小改变的消息
- iPhone 手势识别
- Iphone代码片段导航
- ios 怎么判断当前的输入法
- Dom4j的使用(全而好的文章)
- win 的脚本运行时容易出错了。如下操作就行了。
- Git学习笔记2 给git命令起别名
- windows编程中的char, TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR区别
- 微软企业库--Policy使用Login Handler