如何滚动到表视图的底部



我必须滚动到表视图的底部。在iOS 10中,它运行良好,在iOS 11中,它滚动到表视图的一半并停止。它不会滚动到表视图的底部。

[tableObj scrollRectToVisible:CGRectMake(0, tableObj.contentSize.height - tableObj.frame.size.height,tableObj.frame.size.width, tableObj.frame.size.height) animated:YES];

试试这个怎么样。

let indexPath = IndexPath(row: tableDataList.count - 1, section: 0)
table.scrollToRow(at: indexPath, at: .bottom, animated: true)

最新更新