回到列表顶部:
tableView.scrollRectToVisible(CGRect(x: 0, y: 0, width: tableView.width, height: tableView.height), animated: false)
在tableView上使用,有时会无效,无法回到顶部
解决方法:
if #available(iOS 11.0, *) {
view.estimatedRowHeight = 0;
}
回到列表顶部:
tableView.scrollRectToVisible(CGRect(x: 0, y: 0, width: tableView.width, height: tableView.height), animated: false)
在tableView上使用,有时会无效,无法回到顶部
解决方法:
if #available(iOS 11.0, *) {
view.estimatedRowHeight = 0;
}