点击键盘上的“Next”button实现文本框焦点跳转

时间:2022-03-06 21:50:56

版权声明:本文为博主原创文章,未经博主同意不得转载。 https://blog.csdn.net/quanqinayng/article/details/24405431

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if ([m_phoneTextField isFirstResponder]) {
[m_psdTextField becomeFirstResponder];//跳转到password栏
}else if ([m_psdTextField isFirstResponder]){
[m_phoneTextField resignFirstResponder];//输入password后点击return键盘消失
[m_psdTextField resignFirstResponder];
}
return YES;
}