Просмотр исходного кода

Fix keyboard behavior when editing properties/ivars/methods/defaults in landscape.

Window coordinates don’t account for rotation, so we need to convert the keyboard rect to our view’s coordinate space.
Ryan Olson лет назад: 12
Родитель
Сommit
8413700105
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      Classes/Editing/FLEXFieldEditorViewController.m

+ 2 - 1
Classes/Editing/FLEXFieldEditorViewController.m

@@ -43,7 +43,8 @@
 
 - (void)keyboardDidShow:(NSNotification *)notification
 {
-    CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
+    CGRect keyboardRectInWindow = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
+    CGSize keyboardSize = [self.view convertRect:keyboardRectInWindow fromView:nil].size;
     UIEdgeInsets scrollInsets = self.scrollView.contentInset;
     scrollInsets.bottom = keyboardSize.height;
     self.scrollView.contentInset = scrollInsets;