【发布时间】:2018-08-31 16:48:11
【问题描述】:
请查看 UITableview 中动画问题的视频。当我从 API 获取数据并刷新单元格时,比第一个单元格展开时的动画问题。
我使用下面的代码进行重载。
self.tblSpDirectoryView.reloadRows(at: [IndexPath(row: 3, section: 0)], with: .none)
我也尝试过为此提供解决方案。
self.tblSpDirectoryView.beginUpdates()
self.tblSpDirectoryView.reloadRows(at: [IndexPath(row: 3, section: 0)], with: .none)
self.tblSpDirectoryView.endUpdates()
在上述所有代码之前,我只使用了重新加载。
self.tblSpDirectoryView.reloadData()
这对我没有帮助。我有分享视频文件以供理解please find video file here.
【问题讨论】:
-
删除 begin 和 endUpdates 之间的
self.tblSpDirectoryView.reloadRows(at: [IndexPath(row: 3, section: 0)], with: .none) -
您是否以编程方式计算单元格高度?
-
是的,但我尝试将扩展设置为 140,扩展设置为 500。但同样的问题。你有什么解决办法吗?
标签: ios uitableview swift3 uiviewanimation