浏览代码

Don't offset the view if there's no text input rect

Otherwise this will shift the entire view upwards, which probably isn't what you want.
Sam Lantinga 1 年之前
父节点
当前提交
51628034d9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/video/uikit/SDL_uikitviewcontroller.m

+ 1 - 1
src/video/uikit/SDL_uikitviewcontroller.m

@@ -609,7 +609,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
     CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
 #endif
 
-    if (self.keyboardHeight) {
+    if (self.keyboardHeight && self.textInputRect.h) {
         int rectbottom = (int)(self.textInputRect.y + self.textInputRect.h);
         int keybottom = (int)(self.view.bounds.size.height - self.keyboardHeight);
         if (keybottom < rectbottom) {