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

xiaoxiao2025-03-07  10

回到列表顶部:

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

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

解决方法:

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

 

转载请注明原文地址: https://www.6miu.com/read-5025701.html

最新回复(0)