How to scroll to the exact end of the UITableView?

前端 未结 16 2507
天涯浪人
天涯浪人 2020-12-07 18:48

I have a UITableView that is populated with cells with dynamic height. I would like the table to scroll to the bottom when the view controller is pushed from vi

16条回答
  •  离开以前
    2020-12-07 19:09

    Works in Swift 3+ :

            self.tableView.setContentOffset(CGPoint(x: 0, y: self.tableView.contentSize.height - UIScreen.main.bounds.height), animated: true)
    

提交回复
热议问题