iOS Learning Notes-view up and keyboard bounce back

Source: Internet
Author: User

Original address: http://www.2cto.com/kf/201401/270097.html

In the process of learning iOS development, always meet the keyboard appears, obscuring the output port Uitextfield, can not see the user's own output content. Then you need to move up the current view and click anywhere on the screen at the end of the output to make the keyboard bounce back.

The first method is to add a move view to the method before Uitextfield starts editing and after editing, and the second method is to create a new method of moving the view, both calls, and determines whether to move accordingly.

To post both methods, you need to add the Uitextfielddelegate protocol to the. h file, and you need to set the delegate, skip

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28-29 Change the value of a frame ***////Invoke method before Uitextfield edit-(void) textfielddidbeginediting: (Uitextfield *) TextField {//Set the name of the animation
Related Article

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.