Why does UITableViewCell remain highlighted?

前端 未结 18 1274
余生分开走
余生分开走 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条回答
  •  萌比男神i
    2020-12-12 12:57

    For the Swift users, add this to your code:

    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        tableView.deselectRowAtIndexPath(indexPath, animated: true)
    }
    

    It's paulthenerd's answer except in Swift instead of Obj-C.

提交回复
热议问题