我的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; }];
编辑
我使用以下代码添加视图:
[UIView transitionFromView:fromView toView:toView duration:0.3f options:UIViewAnimationoptionTransitionCrossdissolve completion:nil];
解决方法
您是否在键盘显示之前或之后调用代码将视图移出方式?换句话说,你注册了UIKeyboardWillShowNotification还是UIKeyboardDidShowNotification?
我不知道你在哪里得到键盘大小?再次查看Apple的示例代码,请参阅http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html,向下滚动到位于键盘下方移动内容的部分.