标签:
1:
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
2:
[[self findFirstResponderBeneathView:self] resignFirstResponder];
- (UIView*)findFirstResponderBeneathView:(UIView*)view
{
// Search recursively for first responder
for ( UIView *childView in view.subviews ) {
if ( [childView respondsToSelector:@selector(isFirstResponder)] && [childView isFirstResponder] )
return childView;
UIView *result = [self findFirstResponderBeneathView:childView];
if ( result )
return result;
}
return nil;
}
标签:
原文地址:http://my.oschina.net/u/2303230/blog/405774