How to increase the single row height without reloading UITableView or individual cells [Swift]?

前端 未结 6 648

I want to expand the row height and show the content inside. I show my content in view I want when I tap on a cell it should expand like showed in the image

6条回答
  •  醉酒成梦
    2020-12-17 18:08

    You can try with 2 custom cells. track user selection with variable and reload single cell with below code. when user click on cell load Detailed cell in cellForRowAtIndexPath. your tableView array should contain information which you are showing when cell is expended.

    self.tableView?.beginUpdates()
    var indexPath = NSIndexPath(forRow: rowNumber, inSection: 0)
    self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Top)
    self.tableView?.endUpdates()
    

提交回复
热议问题