1.对键盘进行监听
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardHide:) name:UIKeyboardWillHideNotification object:nil];
#pragma mark 键盘回收
-(void)keyboardHide:(NSNotification *)note
{
self.tableView.contentInset = UIEdgeInsetsZero;
}
#pragma mark 键盘弹出
-(void)keyboardShow:(NSNotification *)note
{
CGRect keyBoardRect = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
}