Why does UITableViewCell remain highlighted?

前端 未结 18 1263
余生分开走
余生分开走 2020-12-12 12:45

What would cause a table view cell to remain highlighted after being touched? I click the cell and can see it stays highlighted as a detail view is pushed. Once the detail

18条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 13:20

    Swift 5 Solution:

    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        tableView.deselectRow(at: indexPath as IndexPath, animated: true)
    }
    

提交回复
热议问题