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

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

    I dont think deselecting the selected row is automatic... I normally do it before pushing to the next view

    - (void)tableView:(UITableView *)tableView 
            didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
        // to do other things
        [self.navigationController pushViewController:yourNextViewController animated:YES];
    }
    

提交回复
热议问题