所以我试图简单地每当用户按下 UITextField 上的返回键时,键盘就会被隐藏,然后它会调用一个函数。现在我有:
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
if(textField == _currentPasswordField)
{
[textField resignFirstResponder];
[_passwordField becomeFirstResponder];
return YES;
}
else if (textField == _passwordField)
{
[textField resignFirstResponder];
[_confirmPasswordField becomeFirstResponder];
return YES;
}
else
{
[textField resignFirstResponder];
[self changePassword];
return YES;
}
}
但是在整个 changePassword 函数返回后,键盘就被隐藏了。我怎样才能隐藏它然后调用我的函数?!
谢谢!