标签:
//隐藏所有键盘:
- (void)hideKeyBoard
{
for (UIWindow* window in [UIApplication sharedApplication].windows)
{
for (UIView* view in window.subviews)
{
[self dismissAllKeyBoardInView:view];
}
}
}
-(BOOL) dismissAllKeyBoardInView:(UIView *)view
{
if([view isFirstResponder])
{
[view resignFirstResponder];
return YES;
}
for(UIView *subView in view.subviews)
{
if([self dismissAllKeyBoardInView:subView])
{
return YES;
}
}
return NO;
}
我认为效率应该很低,慎用!!
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4472087.html