How do I dismiss the iOS keyboard?

后端 未结 16 1137
情书的邮戳
情书的邮戳 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

    You just replace yourTextFieldName with, you guessed it! your textfield. This will close the keyboard.

    [yourTextFieldName resignFirstResponder];
    

提交回复
热议问题