首页 > 解决方案 > InsertRows to UITableView swift 4 有错误:我的最后一行从上到下滚动

问题描述

这是我展开部分时的代码:

let lastScrollOffset = self.tableView.contentOffset
self.tableView.beginUpdates()
self.tableView.insertRows(at: indexPathsForSection(section: section), with: .none)//reloadSections([section], with: .fade)
self.tableView.endUpdates()
self.tableView.layer.removeAllAnimations()
self.tableView.setContentOffset(lastScrollOffset, animated: false)
let indexPath = IndexPath(row: NSNotFound, section: section)
self.tableView.scrollToRow(at: indexPath, at: .none, animated: true)

标签: iosswiftuitableviewiphone7plus

解决方案


推荐阅读