0

Here is my codes when expand section:

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)
vadian
  • 274,689
  • 30
  • 353
  • 361
  • I'm sorry but can you explain the problem a bit better? Possibly with actual and expected behaviour? – Rikh May 26 '20 at 10:18
  • Can you show log or something ? – King.lbt May 26 '20 at 10:29
  • My TableView has first bind some section only, after click on every section, i insert different rows to that section (every row is different define with other xib file), then i scroll my section to top of tableview (self.tableView.scrollToRow), but my last row looklike jump from top to its position – Tùng Lê Thanh May 27 '20 at 03:06

0 Answers0