I have a registration form with three input boxes, namely, name, email, password.
When you enter the name and email when the return key keypad is the NEXT button. I look forward to the effect that when the user selects NEXT,
Focus automatically moves to the next input box kind. For example, moving from a name to the email, and then move to the password input box.
password, ask how to achieve this?
When the password input box when the return key keypad is DONE key.
How can I capture the user presses the DONE key time to do this?
[Name becomeFirstResponder]; such a way, I tried, does not seem to effect ah.
Reply:
1 Set the input box delegate to self, the name, email, password changed to member variables
2 in the class to achieve self UITextFieldDelegate Protocol
In this method, the determination textfield name or email or password is to make a different behavior.
- (BOOL) textFieldShouldReturn: (UITextField *) textField
{
if (textFileld == name)
{
[Password becomeFirstResponder];
return YES;
}
if (textFileld == password)
{
/ / Process done
. . .
return YES;
}
}
Reply:
tried using this method, the situation is that when I finished oh the name field of the input, I NEXT, the keypad is hidden away, is still not in the next email box for input. However, depending on the UI feedback speaking, email field has focus if it is a. Because, adding email with text input box, then he would be clearly out of this operation.
Upstairs brothers, this problem can be solved incorrect? Online.
Reply:
I had originally written by a listener, the initiative calls resignFirstResponder caused.
Thank you, brother upstairs.
No comments:
Post a Comment