Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发送图片卡死问题 #27

Open
ghost opened this issue Sep 22, 2015 · 3 comments
Open

发送图片卡死问题 #27

ghost opened this issue Sep 22, 2015 · 3 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Sep 22, 2015

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

@ghost
Copy link
Author

ghost commented Sep 25, 2015

-(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
Copy link
Author

ghost commented Sep 25, 2015

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

@ZhipingYang
Copy link
Owner

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

@ZhipingYang ZhipingYang self-assigned this Nov 3, 2015
@ZhipingYang ZhipingYang added this to the V1.0 milestone Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant