UI图
UI图
分析需求:tableView分了三个section,每个cell里面都有个textField,编辑textField时候,点击return跳转到下一个row或者section中的textField
目的,拿到当前cell点击跳转后下一个cell
//返回下一个即将跳转到的cell
-(UITableViewCell *)getNextCellwithCurrentCell:(UITableViewCell *)cell{
NSIndexPath * indexPath = [self.tableView indexPathForCell:cell];
NSLog(@"当前区 = %ld,row = %ld",indexPath.section,indexPath.row);
NSIndexPath * indexPath2;
NSArray *dataArray = self.allInfoArray[indexPath.section];
if (indexPath.row + 1 >= [dataArray count]) {
indexPath2 = [NSIndexPath indexPathForRow:0 inSection:indexPath.section+1];
}else{
indexPath2 = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section];
}
UITableViewCell * nextCell = [self.tableView cellForRowAtIndexPath:indexPath2];
return nextCell;
}
网友评论