Keyboard pops up after UIAlertView is dismissed on iOS 8.3 for iPad

前端 未结 7 1324
小鲜肉
小鲜肉 2021-01-31 03:15

With the latest iOS 8.3 release, our app starts to have a weird behavior.

After finishing textfield editing, the user can click the close button which brings up an

相关标签:
7条回答
  • 2021-01-31 04:04

    If a text field is the first responder, it will automatically pop up the keyboard when the alert is dismissed. Ensure the first responder is properly dismissed with:

    [textField resignFirstResponder]
    

    Remember: in a table or scroll view, sometimes the field must be visible on the screen to properly dismiss the responder.

    If there are no first responders active, keyboard should not appear when alert is dismissed.

    For the particular case in this question, I would recommend setting a delegate method to listen for the "done" button and resigning the first responder in the delegate callback.

    Alternatively, when beginning editing, you can store a reference to the currently active text field, then in your "clickedButtonAtIndex" method you can resign the active text field if it is still active.

    0 讨论(0)
提交回复
热议问题