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

IQKeyboardManager第三方键盘冲突 #145

Open
huhangatzz opened this issue Jun 15, 2021 · 1 comment
Open

IQKeyboardManager第三方键盘冲突 #145

huhangatzz opened this issue Jun 15, 2021 · 1 comment

Comments

@huhangatzz
Copy link

如果我使用IQKeyboardManager第三方键盘,当我收回键盘resignFirstResponder时,会导致界面错乱。如何解决此问题

@listenzz
Copy link
Owner

在发生问题的 UIViewController 添加如下代码即可,可能是 IQKeyboardManager 修改了 self.edgesForExtendedLayout 的值

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    NSLog(@"safeAreaInsets: %@", NSStringFromUIEdgeInsets(self.view.safeAreaInsets));
    NSLog(@"additionalSafeAreaInsets: %@", NSStringFromUIEdgeInsets(self.additionalSafeAreaInsets));
    NSLog(@"%lu", (unsigned long)self.edgesForExtendedLayout);
    self.edgesForExtendedLayout = self.edgesForExtendedLayout | UIRectEdgeTop;
}

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

2 participants