ios键盘高度
2013-04-03 11:08
267 查看
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
-(void)keyboardWillShow:(NSNotification*)notification{
NSDictionary*info=[notification userInfo];
CGSize kbSize=[[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size;
//
NSValue *animationDurationValue = [info objectForKey:UIKeyboardAnimationDurationUserInfoKey];
NSTimeInterval animationDuration;
[animationDurationValue getValue:&animationDuration];
NSLog(@"keyboard changed, keyboard width = %f, height = %f,animationDuration =%f",
kbSize.width,kbSize.height,animationDuration);
}
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
-(void)keyboardWillShow:(NSNotification*)notification{
NSDictionary*info=[notification userInfo];
CGSize kbSize=[[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size;
//
NSValue *animationDurationValue = [info objectForKey:UIKeyboardAnimationDurationUserInfoKey];
NSTimeInterval animationDuration;
[animationDurationValue getValue:&animationDuration];
NSLog(@"keyboard changed, keyboard width = %f, height = %f,animationDuration =%f",
kbSize.width,kbSize.height,animationDuration);
}
相关文章推荐
- iOS动态获取键盘高度
- iOS监测第三方键盘高度
- ios监视键盘高度
- iOS输入框根据键盘高度自适应
- iOS键盘中英文切换键盘高度获取通知方法
- iOS监听键盘弹出,获取键盘的高度
- iOS -- textfield输入时键盘升起,改变view高度
- iOS开发之监听键盘高度的变化
- ios --- 动态获取键盘高度
- iOS技巧——即时监听键盘高度
- 适应iOS中的键盘高度变化
- ios --- 动态获取键盘高度
- iOS键盘自适应高度
- iOS积累--textField获取键盘高度以及限制字数
- iOS开发之监听键盘高度的变化
- iOS 获取键盘高度
- ios开发 监听键盘frame变化事件获取键盘高度( ios8&ios7 横竖屏旋转时需要注意的问题)
- iOS输入框随着键盘高度改变
- iOS 监听键盘的高度 - NSNotificationCenter
- ios动态获取键盘高度