diff --git a/KeyBoardTest/KeyBoardTest.xcodeproj/project.xcworkspace/xcuserdata/FYTech.xcuserdatad/UserInterfaceState.xcuserstate b/KeyBoardTest/KeyBoardTest.xcodeproj/project.xcworkspace/xcuserdata/FYTech.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..3c38e16 Binary files /dev/null and b/KeyBoardTest/KeyBoardTest.xcodeproj/project.xcworkspace/xcuserdata/FYTech.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/KeyBoardTest/KeyBoardTest.xcodeproj/xcuserdata/FYTech.xcuserdatad/xcschemes/xcschememanagement.plist b/KeyBoardTest/KeyBoardTest.xcodeproj/xcuserdata/FYTech.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8bbf6ff --- /dev/null +++ b/KeyBoardTest/KeyBoardTest.xcodeproj/xcuserdata/FYTech.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + KeyBoardTest.xcscheme + + orderHint + 0 + + + + diff --git a/KeyBoardTest/KeyBoardTest/UIViewController+KeyboardCorver.m b/KeyBoardTest/KeyBoardTest/UIViewController+KeyboardCorver.m index ef068c2..35d8c19 100644 --- a/KeyBoardTest/KeyBoardTest/UIViewController+KeyboardCorver.m +++ b/KeyBoardTest/KeyBoardTest/UIViewController+KeyboardCorver.m @@ -84,7 +84,7 @@ - (void)keyboardNotify:(NSNotification *)notify{ if ([notify.name isEqualToString:UIKeyboardWillShowNotification]) {//键盘显示 [self findFirstResponse:self.view]; UIView * tempView = self.objectView; - CGRect rect = [tempView.superview convertRect:tempView.frame fromView:self.view];//计算响应者到和屏幕的绝对位置 + CGRect rect = [tempView.superview convertRect:tempView.frame toView:nil];//计算响应者到和屏幕的绝对位置 CGPoint point = rect.origin; CGFloat keyboardY = APPWINDOWHEIGHT - keyboardHeight; CGFloat tempHeight = point.y + tempView.frame.size.height;