Several ways to hide keyboard in iOS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.