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

2015-06-22 0 833
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

{


}

遇见资源网 objective-c iOS监听系统键盘的出现和消失 http://www.ox520.com/17516.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务