我有一个表,其中有一些行,每行包含一个文本字段。当文本字段更新时,表的某些行必须更新以显示一些新数据。只要表格根本不向下滚动,这样就可以正常工作。
但是,如果滚动表,则重新加载行会导致表的“跳转”动画。我的代码:
formFieldsTable.reloadRows(at: [indexPath,indexPath2], with: .none)
答案 0 :(得分:2)
根据上述其中一条评论,我为我解决了同样的问题:
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 75.0
}
override func viewDidLoad() {
super.viewDidLoad()
formFieldsTable.estimatedRowHeight = 75
...
}