UITableView bouncing back to the top of a section when calling reloadRowsAtIndexPaths

后端 未结 9 1910
既然无缘
既然无缘 2020-12-15 03:14

When a user taps a button in one of my rows I am updating the underlying model for that row and then calling reloadRowsAtIndexPaths for the given row (i.e. single row reload

9条回答
  •  天命终不由人
    2020-12-15 04:11

    Swift 4.2

    This can work anywhere you want to remove animation. During reload of table , table section or any row

     UIView.performWithoutAnimation({
                    cell.configureSelection(isSelected: true)
                    tableView.reloadSections([1], with: .none)
                    tableView.allowsSelection =  false
    
                })
    

提交回复
热议问题