将UITextField的委托设置为ViewController类。覆盖textfieldShouldReturn并调用resignFirstResponder ...
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return NO;
}
编辑:
看到评论之后看来你是初学者... This博客文章讲述了UITextField和代表......如果你有时间,也请阅读this帖子(了解协议和代表..)