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 |