In iOS development, it is often necessary to enter information. There are two ways of entering information: Uitextfield and Uitextview. After the information input is completed, you need to hide the keyboard, here are a few ways to hide the keyboard.
< a > Click the Return button on the keyboard to hide the keyboard
1, Uitextfield
Compliance Agreement
Set up Proxy
Using methods in proxies
2, Uitextview
Compliance Agreement
Set up Proxy
Using methods in proxies
< two > Add a button on the keyboard, click the button to hide the keyboard
Set button
1. Uitextfield
2. Uitextview
Add a hidden keyboard method
< three > Click a blank location other than the keyboard to hide the keyboard.
Let the input control discard the first responder identity in the Touchesbegan:withevent: method
< four > Add gestures, click a blank location other than the keyboard to hide the keyboard
< five > just click on the blank screen except the keyboard, regardless of which control pops up on the keyboard, the keyboard is hidden
Jerry Education
Source:http://www.cnblogs.com/jerehedu/
This article is the copyright of Yantai Jerry Education Technology Co., Ltd. and the blog Park is shared, welcome reprint, but without the consent of the author must retain this paragraph statement, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.
Several ways to hide keyboard in iOS