【发布时间】:2021-07-17 15:15:19
【问题描述】:
我正在使用UITableView(frame: .zero, style: .grouped) 与多个部分和单元格的动态高度。每个部分都有一个标题。
我正在尝试滚动到表格视图的底部
let lastSection = tableView.numberOfSections - 1
let lastIndexPath = IndexPath(row: tableView.numberOfRows(inSection: lastSection) - 1, section: lastSection)
tableView.scrollToRow(at: lastIndexPath, at: .bottom, animated: true)
我的问题是:
当部分中只有一项时,表格视图将滚动到标题而不是该项。当有多个项目时,一切正常。
另外对于plain风格的table view,一切正常。
【问题讨论】:
标签: ios swift uitableview uikit