UITableView does not automatically deselect the selected row when the table re-appears

前端 未结 7 571
感动是毒
感动是毒 2021-02-03 17:45

Normally a selected row in a UITableView gets deselected with an animation when the user pops back from the detail view.

However, in my case where I have a

相关标签:
7条回答
  • 2021-02-03 18:26

    If table view selections are not being cleared in a subclass of UITableViewController, despite the fact that clearsSelectionOnViewWillAppear is set to true, make sure to call the superclass version of [UIViewController viewWillAppear:animated] if you override that method.

    If you fail to call the super version of that method, the value of clearsSelectionOnViewWillAppear will have no effect as the work of clearing the table view selection is actually performed in UITableViewController's implementation of viewWillAppear.

    If your view controller does not inherit from UITableViewController you will need to clear the selection manually in viewWillAppear.

    0 讨论(0)
提交回复
热议问题