我在键盘顶部有一个带有上一个和下一个按钮的工具栏。当我按下下一个按钮时,下一个文本字段应该成为第一响应者,但这不会发生。这是我的代码。
-(IBAction) nextfield {
if([name isFirstResponder] == TRUE) {
[name resignFirstResponder];
[surname becomeFirstResponder];
if(surname.editing == TRUE)
NSLog(@"surname");
}
if([surname isFirstResponder] == TRUE) {
[email becomeFirstResponder];
}
if([email isFirstResponder] == TRUE) {
[password becomeFirstResponder];
}
if([password isFirstResponder] == TRUE) {
[confirm becomeFirstResponder];
}
if([confirm isFirstResponder] == TRUE) {
[country becomeFirstResponder];
}
if([country isFirstResponder] == TRUE) {
if(country.text == @"United States") {
[state setEnabled:TRUE];
[state becomeFirstResponder];
}
else {
[type becomeFirstResponder];
}
}
if([state isFirstResponder] == TRUE) {
[type becomeFirstResponder];
}
if ([type isFirstResponder] == TRUE) {
[name becomeFirstResponder];
}
}
我进入日志“姓氏”,但光标没有出现,如果我输入一些东西,它不会出现在任何地方。