resignFirstResponder not hiding keyboard on textFieldShouldReturn

后端 未结 14 1690
我在风中等你
我在风中等你 2020-12-05 10:11

I have a view with a UITextField which should hide the keyboard when return is pressed.

My function is this:

- (BOOL)textFieldShouldReturn:(UITextFie         


        
14条回答
  •  無奈伤痛
    2020-12-05 10:21

    I see you have the iPad tag on this. Do you happen to be presenting a modal view using UIModalPresentationFormSheet? If so, it looks like this is a limitation of the FormSheet modal presentation (either Apple is doing it intentionally for some reason, or it is a bug). See these other questions for more details:

    Modal Dialog Does Not Dismiss Keyboard

    Modal View Controller with keyboard on landscape iPad changes location when dismissed

提交回复
热议问题