resignFirstResponder not hiding keyboard on textFieldShouldReturn

后端 未结 14 1694
我在风中等你
我在风中等你 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:45

    There is this helpful method which allows you to dismiss the keyboard when presenting the Modal Dialog:

     - (BOOL)disablesAutomaticKeyboardDismissal { return NO; }
    

    This will override the default behavior of the modal dialog set by Apple and allow you dismiss the keyboard. It is in the UIViewController Class.

    I hope this helps someone!

提交回复
热议问题