How do I dismiss the iOS keyboard?

后端 未结 16 1165
情书的邮戳
情书的邮戳 2020-11-29 20:00

I have a UITextfield that i\'d like to dismiss the keyboard for. I can\'t seem to make the keyboard go away no matter what code i use.

16条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 20:09

    1. Set up the "Did End On Exit" event in Xcode (right click on your text field).

    2. Realize this method:

      -(IBAction) closeKeyboard:(id) sender {
          [_txtField resignFirstResponder];
      }
      

提交回复
热议问题