UIKeyboardDidShowNotification called multiple times, and sometimes with incorrect keyboard dimensions

前端 未结 4 781
醉话见心
醉话见心 2021-02-07 08:12

I am trying to move a UITextView above the keyboard whenever the keyboard appears/changes. Let\'s say I have the English keyboard displaying and then switch directly to the Chin

4条回答
  •  一个人的身影
    2021-02-07 09:03

    If you're using the Cmd+K shortcut on the simulator to show/hide the keyboard, it may get called multiple times since that doesn't resign the textfield as the first responder.

    If you instead use the keyboard's Return button then it will do the right thing and resign it.

提交回复
热议问题