方法一:
//1, 关闭键盘
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
如果一个view上好多输入框,我们可以关闭弹出的软键盘要遍历然后调用resignFirstResponder
或者在隐藏键盘的方法中调用 [[[UIApplication sharedApplication] keyWindow] endEditing:YES];
方法二:
//2, 关闭键盘
[[self findFirstResponderBeneathView:self] resignFirstResponder];
//打开键盘
[[self findFirstResponderBeneathView:self] becomeFirstResponder];
方法三:
直接某一个的 [text resignFirstResponder]; 就OK了