我在UItableView中有一些UITextfields。文本字段已经在我创建的UITableViewCell中进行了分类。在按下键盘上的返回键后,我会知道如何进入下一个单元格。跳转到下一个UItextField
因此,如果用户是开始宽,他们将继续向下宽度科拉姆,或者如果他们想进入高度每次他们打的时间进入,他们将继续沿着列。
目前发生了什么是如果我使用宽度科拉姆,它工作正常,但如果我按下回车键后选择一个高度的UITextField它跳转到下一个单元格的宽度。
这是我检测返回键的代码。
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[[self.view viewWithTag:textField.tag+1] becomeFirstResponder];
return YES;
}
这就是我的单元格tableview的样子。
任何帮助,将不胜感激。
欲了解更多信息,这是我如何将自定义celltextfields添加到UItextfield。
NSString *widthString = [currentFinishingDictionary objectForKey:@"w"];
if ((NSNull *) widthString != [NSNull null]) {
cell.widthTexField.text = widthString;
cell.widthTexField.delegate = self;
cell.widthTexField.tag = indexPath.row;
} else {
cell.widthTexField.text = @" ";
cell.widthTexField.delegate = self;
cell.widthTexField.tag = indexPath.row;
}
NSString *heightString = [currentFinishingDictionary objectForKey:@"h"];
if ((NSNull *) heightString != [NSNull null]) {
cell.heightTextField.text = heightString;
cell.heightTextField.delegate = self;
cell.heightTextField.tag = indexPath.row;
} else {
cell.heightTextField.text = @" ";
cell.heightTextField.delegate = self;
cell.heightTextField.tag = indexPath.row;
}
单个单元格是否包含1个宽度文本字段和1个高度文本字段? – sanjaymathad
是的,它的剂量.... – HurkNburkS