为什么我的UIView的一部分覆盖了键盘?

Que*_*mia 10 keyboard uiview ipad ios

我的部分UIView覆盖了iPad的键盘.

在此输入图像描述

你看到的视图只是我作为子视图添加到主视图中的UIView.当键盘显示时,我确实将视图向上移动.

有没有人见过这个?

编辑

显示键盘时,我向上移动视图:

[UIView animateWithDuration:SHOW_KEYBOARD_ANIMATION_DURATION animations:^{
    CGRect frame = self.currentViewController.view.frame;
    frame.origin.y -= SHOW_KEYBOARD_OFFSET;

    self.currentViewController.view.frame = frame;
}];
Run Code Online (Sandbox Code Playgroud)

编辑

我使用以下代码添加视图:

[UIView transitionFromView:fromView toView:toView duration:0.3f options:UIViewAnimationOptionTransitionCrossDissolve completion:nil];
Run Code Online (Sandbox Code Playgroud)

小智 1

您是否在显示键盘之前或之后调用代码以将视图移开?换句话说,您正在注册 UIKeyboardWillShowNotification 或 UIKeyboardDidShowNotification 吗?

不知道你从哪里得到的键盘尺寸?再看一下Apple的示例代码,参见http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html,向下滚动到位于移动内容的部分在键盘下。