键盘即将显示的通知
- (void)showKeyboard
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
}
键盘即将消失的通知
- (void)hiddenKeyboard
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil];
}
键盘即将显示
- (void)keyboardWillShow:(NSNotification *)notification
{
NSDictionary *kbInfo=[notification userInfo];
CGSize kbSize=[[kbInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
CGFloat kbHeight = kbSize.height;// 键盘高度
}
键盘即将消失
- (void)keyboardWillHidden:(NSNotification *)notification
{
}
网友评论