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

Keyboard 和 customview 并不在同一坐标系,在presentViewController的view中弹出popview的话,customViewMaxY计算不对 #40

Open
chance168 opened this issue Aug 24, 2021 · 0 comments

Comments

@chance168
Copy link

Keyboard 和 customview 并不在同一坐标系,在presentViewController的view中弹出popview的话,customViewMaxY计算不对,可以这样修改:
- (void)keyboardWillShow:(NSNotification *)notification这个方法中修改:
CGFloat customViewMaxY = self.customView.pv_Bottom + self.avoidKeyboardSpace;
改成

CGRect cf = [self.customView convertRect:self.customView.bounds toView:[UIApplication sharedApplication].keyWindow];
CGFloat customViewMaxY = cf.origin.y + cf.size.height + self.avoidKeyboardSpace;
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