resignFirstResponder not hiding keyboard on textFieldShouldReturn

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

    The easiest way is:

    1. Go to your user interface builder,

    2. select UITextField and "Control-Drag" to "Detail View Controller-Detail" and release.

    3. The window will pop-up. Then under "Outlets" select "Delegate".

    That's it. It worked for me.

提交回复
热议问题