iOS11以上系统使用scrollRectToVisible回到顶部失效的解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jacob_ios/article/details/83375607

回到列表顶部:

tableView.scrollRectToVisible(CGRect(x: 0, y: 0, width: tableView.width, height: tableView.height), animated: false)

在tableView上使用,有时会无效,无法回到顶部

解决方法:

 if #available(iOS 11.0, *) {
            view.estimatedRowHeight = 0;
  }

猜你喜欢

转载自blog.csdn.net/jacob_ios/article/details/83375607
今日推荐