As an iOS developer, you often need to work with forms. So I summed up the way the keyboard was picked up, iOS has three ways to close the keyboard (if there are other ways to pick up the keyboard, make a mistake in the message area).
1. Close the keyboard when you click return button
-(BOOL) Textfieldshouldreturn: (Uitextfield *) textfield{ return [TextField Resignfirstresponder];}
2. Click on the background view to close the keyboard (your view must be inherited from Uicontrol)
[Self.view Endediting:yes];
3, you can add this sentence anywhere, can be used to unify the keyboard
[[[UIApplication sharedapplication] Keywindow] endediting:yes];
This method I met recently, feel useful, it is written down.
Blog Garveycalvin
Blog Source:http://www.cnblogs.com/GarveyCalvin/
This article copyright belongs to the author and the blog Garden altogether, welcome reprint, but must retain this paragraph statement, and gives the original link, thanks cooperation!
iOS Development-closing/collecting keyboard methods Summary