IOS development to cancel text field input keypad
- 2020-05-07 20:30:00
- OfStack
First select TextFields in Interface Builder, then find Text Input Traits in Text Field Attributes, and select Return Key as done. OK
Define methods
- (IBAction) textFieldDoneEditing (id) sender; // press Done to close the keyboard
Implementation method
// According to the Done Close the keyboard after pressing
- (IBAction) textFieldDoneEditing:(id)sender
{
[sender resignFirstResponder];
}
Then find the event Did End On Exit, associated with textFieldDoneEditing, OK.
The above is all the content of this article, I hope you can enjoy it