ios - 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)
解决方案
推荐阅读
- vuejs2 - 如何在圆环图标签中强制换行?
- c++ - 访问说明符,无法调用派生类中定义的函数
- javascript - 当 this.props 传递给子组件时,它变为 undefined
- android - “Android Logcat”和“Postman”的结果不同,状态均为 200 OK
- delphi - Delphi SuperObject - 是否有一个(递归)搜索函数可以告诉在哪里可以找到一个值?
- neo4j - Cypher count() 返回不存在节点的值
- angular - 将 Angular 4 项目升级到 Angular 6
- date - 我想要一个 xquery 函数,它返回当前日期和时间以及毫秒
- java - 接收 fcm 通知时更新回收站视图
- sails.js - "E_INVALID_NEW_RECORD",