Skip to content

Commit

Permalink
调整滚动到顶部位置
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Oct 8, 2024
1 parent bce1375 commit c082f17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Controller/MessageListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit c082f17

Please sign in to comment.