-(BOOL) textFieldShouldReturn:(UITextField*) theTextField{
[theTextField resignFirstResponder];
return YES;
}
它不起作用....
答案 0 :(得分:3)
This answer表明代表决定是否关闭键盘。
如果要关闭键盘,textFieldShouldReturn:必须返回NO:
-(BOOL) textFieldShouldReturn:(UITextField*) theTextField{
[theTextField resignFirstResponder];
return NO;
}