//键盘弹出
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
//键盘收起
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardHide:) name:UIKeyboardWillHideNotification object:nil];
- (void)keyboardWillShow:(NSNotification *)note
{
// 取出键盘的高度
CGRect temp = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat height = temp.size.height;
[self animateTaskView:self.chatListView show:NO];
}
-(void)keyboardHide:(NSNotification *)note
{
[self.view endEditing:YES];
}