Method One:
1. Turn off the keyboard
[[[UIApplication sharedapplication] Keywindow] endediting:yes];
Presumably everyone has encountered a view on a lot of input boxes, in order to close the soft keyboard pop-up to traverse and then call Resignfirstresponder it? I found a key today. The keyboard that may be open on this view is simple: [Self.view endediting:yes];
It's straight OK.
Method Two:
2. Turn off the keyboard
[[Self findfirstresponderbeneathview:self] resignfirstresponder];
[[Self findfirstresponderbeneathview:self] becomefirstresponder];//open keyboard
-(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;
}
IOS Keyboard Recycling--in Lan Yi education