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

前端 未结 7 574
感动是毒
感动是毒 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:10

    Do the deselection in didSelectRowAtIndexPath instead of viewWillAppear:

    - (void)tableView:(UITableView *)tableView
                      didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
         //show the second view..
         [tableView deselectRowAtIndexPath:indexPath animated:YES]; 
     }
    

提交回复
热议问题