UUChatTableView
UUChatTableView copied to clipboard
发送图片卡死问题
在聊天页面发送图片,如果图片过多时,在输入文字键盘弹出时点击语音按钮出现卡死现象。
-(void)keyboardChange:(NSNotification *)notification { NSDictionary *userInfo = [notification userInfo]; NSTimeInterval animationDuration; UIViewAnimationCurve animationCurve; CGRect keyboardEndFrame;
[[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve];
[[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration];
[[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardEndFrame];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:animationDuration];
[UIView setAnimationCurve:animationCurve];
//adjust ChatTableView's height
if (notification.name == UIKeyboardWillShowNotification) {
self.bottomConstraint.constant = keyboardEndFrame.size.height+40;
//弹出键盘时,立马刷新
[self.view layoutIfNeeded];
}else{
self.bottomConstraint.constant = 40;
//弹去键盘时,等下一个时间片执行
[self.view setNeedsLayout];
}
//图片过多时,键盘弹下去用此方法会主线程堵塞
// [self.view layoutIfNeeded];
//adjust UUInputFunctionView's originPoint
CGRect newFrame = IFView.frame;
newFrame.origin.y = keyboardEndFrame.origin.y - newFrame.size.height;
IFView.frame = newFrame;
[UIView commitAnimations];
}
#import "SChatController.h" 在这个类里面修改就好了。
ok, 我去看看。没有注意到这些点。thks