通常情况下,当用户从细节视图中弹出时,UITableView
中的选定行会被动画取消 Select .
然而,在我的例子中,我在UIViewController
中嵌入了UITableView
,我必须在viewWillAppear
中手动执行,就像这样:
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
// For some reason the tableview does not do it automatically
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow
animated:YES];
}
这是为什么?如何解决?