1. After setting the first responder of the keyboard, you can click TextField to summon the keyboard
The first responder method for setting the keyboard is:
[TextField Becomefirstresponder]; //At this time, the TextField input box is the first responder of the current keyboard, so only TextField lose the first responder, the keyboard will disappear
The method for setting the keyboard to lose the first responder is:
[TextField Resignfirstresponder]; //generally in the corresponding event of setting the Click button, or in the UIView click Trigger Event (at which point the screen can be answered wherever it is clicked)
2. If a QQ account input box, and a password input box and login button
When you click on the QQ input box, the keyboard responds, set the keyboard to the bottom right button is next, click Next after the keyboard first responder into the password input box, this time the keyboard right button to do, click the keyboard disappears
A. First set the corresponding QQ input box in the lower right corner button is next, the code is:
[_textfield_qq setreturnkeytype: Uireturnkeynext];
Then set the password input box to the bottom right button is done and the code is:
[_textfield_password setreturnkeytype:uireturnkeydone ];
B. Add the <UITextFieldDelegate> protocol to the. h file in TextField, and return to the. m file with the return key method such as the following:
-(BOOL) Textfieldshouldreturn: (uitextfield *) TextField {
if (TextField = = _textfield_qq) {// _textfield_qq and _textfield_password have been set as attributes to infer the first responder of the keyboard, assuming that the QQ input box
return [_textfield_passwordbecomefirstresponder]; Click Nextbutton in the lower right corner to set the first responder to _textfield_password, which is the Password entry box
}Else{
return [_textfield_passwordresignfirstresponder]; ///Otherwise (the first responder of the keyboard is the password input box), which causes the keyboard to lose its first responder, which disappears
}
}
An < in the IOS keyboard protocol uitextfielddelegate>