【发布时间】:2016-07-11 10:09:09
【问题描述】:
我正在使用 UITableView 构建聊天界面。我正在使用下面的代码添加单元格
self.tableView.beginUpdates()
self.tableView.insertRows(at: [IndexPath(row: self.messageCards.count - 1, section: 0)], with: .bottom)
self.tableView.endUpdates()
添加后我使用 scrollToRowAtIndexPath 来显示最后插入的行。
let indexPath = IndexPath(row: self.messageCards.count - 1, section: 0)
self.tableView.scrollToRow(at: indexPath, at: .bottom, animated: false)
但最后两个动画都在混合,滚动并不顺利。
【问题讨论】:
-
想要的动画序列应该是什么......
-
@RohitKP 首先我想向上滚动并想使用动画显示新消息
标签: ios swift uitableview uiscrollview