调整滚动到顶部位置

This commit is contained in:
Fin 2024-10-08 15:09:09 +08:00
parent bce1375ac1
commit c082f173f0

View File

@ -225,7 +225,9 @@ class MessageListViewController: BaseViewController<MessageListViewModel> {
}
private func scrollToTop() {
self.tableView.setContentOffset(CGPoint(x: 0, y: -250), animated: false)
if self.tableView.visibleCells.count > 0 {
self.tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: true)
}
}
}