Skip to content

Instantly share code, notes, and snippets.

@ruandao
Last active August 29, 2015 13:57
Show Gist options
  • Save ruandao/9429941 to your computer and use it in GitHub Desktop.
Save ruandao/9429941 to your computer and use it in GitHub Desktop.
让textview 失去焦点, 处理方法是, 当点击空白地方的时候(tap事件),让keyboard 消失
// 然后鉴于,一个页面里面可能有多个输入源, so 遍历下面
for (UIView *view in self.view.subviews) {
if ([view isFirstResponder]){
[view resignFirstResponder];
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment