2011-05-28 27 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];