UUChatTableView icon indicating copy to clipboard operation
UUChatTableView copied to clipboard

发送图片卡死问题

Open ghost opened this issue 8 years ago • 3 comments

在聊天页面发送图片,如果图片过多时,在输入文字键盘弹出时点击语音按钮出现卡死现象。

ghost avatar Sep 22 '15 12:09 ghost

-(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];

}

ghost avatar Sep 25 '15 02:09 ghost

#import "SChatController.h" 在这个类里面修改就好了。

ghost avatar Sep 25 '15 02:09 ghost

ok, 我去看看。没有注意到这些点。thks

ZhipingYang avatar Nov 03 '15 16:11 ZhipingYang