ios 监听系统键盘的出现和消失


//注册键盘出现的通知

    [[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

{


}

文章来自:http://blog.csdn.net/wangzhaobin/article/details/46043337
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3