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

时间:2015-05-27 12:22:10   收藏:0   阅读:20068


//注册键盘出现的通知

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!