I want to resign first responder of a UITextField object upon the user pressing done. Is there a way to do this using the interface builder alone? Or must I do it programmatically by using the delegate instance method:
-(BOOL)textFieldShouldReturn:(UITextField *)textField
It must be done programatically, you'd do it like this
- (IBAction)doneEditing:(id)sender {
[textView resignFirstResponder];
}
You'd assign the doneEditing method to your Done button.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.