【发布时间】:2017-09-04 14:32:10
【问题描述】:
我有很长的文本字段列表,所以我使用的是 tableView。
this is how the screen looks like
当我在其中一个单元格的文本字段中插入一些文本并向下滚动其他一些单元格时,会获得相同的文本字段值。我不知道为什么会发生这种情况。
这是我现在的代码:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cellId", for: indexPath) as! RelatieToevoegenCell
cell.label.text = items[indexPath.row]
cell.textfield.placeholder = items[indexPath.row]
return cell
}
【问题讨论】:
-
如何处理文本字段的编辑?请提供更多背景信息。
-
@DávidPásztor 目前我没有对文本字段做任何事情,我只是输入其中一个,当我向下滚动时,不同单元格中的其他文本字段会得到相同的文本
标签: ios swift uitableview