code_junkie

How can I disable the UITableView selection highlighting?

Nov 11th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  2.  
  3. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  4.  
  5. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  6.  
  7. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  8. {
  9. // A case was selected, so push into the CaseDetailViewController
  10. UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  11. if (![cell selectionStyle] == UITableViewCellSelectionStyleNone) {
  12. // Handle tap code here
  13. }
  14. }
  15.  
  16. [tableView setAllowsSelection:NO];
  17.  
  18. [cell setUserInteractionEnabled:NO];
  19.  
  20. [tableView setUserInteractionEnabled:NO];
  21.  
  22. cell.userInteractionEnabled = NO;
  23.  
  24. tableView.allowsSelection = NO;
  25.  
  26. cell.selected = NO;
Add Comment
Please, Sign In to add comment