UITextField not getting keyboard input

后端 未结 4 716
我在风中等你
我在风中等你 2020-12-09 05:51

I\'m having troubles entering text into an UITextField under a SVProgressHUD (Basically an UIView with a full-screen transparent UIWindow and some UIView subviews showing te

4条回答
  •  轮回少年
    2020-12-09 06:17

    I finally found the problem: SVProgressHUD calls makeKeyAndVisible when it's initialized, because it wants to receive keyboard notifications for repositioning. I looked up what the "Key Window" actually is and found out:

    ...The key window responds to user input...

    Now, as the UIWindow of the SVProgressHUD was the keyWindow, my other window, which contained the UITextField did not get the user input.

    I finally call makeKeyWindow on the AppDelegate's window and everything is working fine.

    I hope this helps anyone with similar problems.

提交回复
热议问题