在用户完成输入或则点击空白时,我们希望能够隐藏键盘。可用如下Code实现。
// _searchBar是当前输入的焦点。
- (IBAction)dismissKeyboard:(id)sender;
{
[_searchBar resignFirstResponder];
}
在用户完成输入或则点击空白时,我们希望能够隐藏键盘。可用如下Code实现。
// _searchBar是当前输入的焦点。
- (IBAction)dismissKeyboard:(id)sender;
{
[_searchBar resignFirstResponder];
}
转载于:https://www.cnblogs.com/MobileDevelop/archive/2010/07/17/1779768.html