Auto scrolling to a cell with a specific value

后端 未结 4 1643
盖世英雄少女心
盖世英雄少女心 2020-12-14 09:06

I have a list of numbers in a table view like this.

\"enter

As you can see th

4条回答
  •  情话喂你
    2020-12-14 09:47

    Swift 4:

    let indexPath = IndexPath(row: row, section: section)
    tableView.scrollToRow(at: indexPath, at: .top, animated: true)
    

    (first, of course, you have to assign values to row and section based on which cell you want to scroll to)

提交回复
热议问题