2011-05-28 87 views
0

我有一个UITableView,在我的cellForRowsAtIndexPath,我有这样的:如何在按下后隐藏UITableViewCellSelection?

cell.selectionStyle = UITableViewCellSelectionStyleBlue; 

然而,在我的UINavigationController发生后的动作和我回去,它仍然选择。此外,我有一个UIAlertView弹出我的行动之一。如何在用户完成点击后隐藏它。

感谢

回答

2

覆盖的委托方法:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    [tableView deselectRowAtIndexPath:indexPath animated:YES]; 
} 
+0

谢谢,成功了! – iosfreak 2011-05-28 17:07:17

1

你可以这样做:像这样

[yourTableView deselectRowAtIndexPath:[yourTableView indexPathForSelectedRow] animated:NO];