如何使UITableView上的单元格不可选?
我有一个单元格,我插入到UITableView的顶部。 我怎样才能确保当用户点击单元格时,它不显示蓝色选定的指标?
将UITableViewCell的select样式设置为UITableViewCellSelectionStyleNone 
要完全不可select,需要两件事情:
1-正如别人所说:
 cell.selectionStyle = UITableViewCellSelectionStyleNone; 
2-你需要实现这个委托方法:
 // Called before the user changes the selection. Return a new indexPath, or nil, to change the proposed selection. - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath]; if(cell.selectionStyle == UITableViewCellSelectionStyleNone){ return nil; } return indexPath; } 
你可以做
 cell.selectionStyle = UITableViewCellSelectionStyleNone; 
从故事板为表视图设置以下内容:
select :没有select
显示select在触摸 :错误
  
 
Swift语法:
 cell.selectionStyle = UITableViewCellSelectionStyle.None 
我从禁用TableViewCell的angular度回答。 你可以使用故事板。
 XCode Version 8.2.1 (8C1002) 
select故事板上的TableVewCell,以下内容将在右侧面板 – Utilities中可见。
  
 
做select:没有
就这样!
 myTable.allowsSelection = false 
Swift 3中的更新:
 cell.selectionStyle = UITableViewCellSelectionStyle.none 
 实现这个UITableViewDelegate方法 
 - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath { return NO;} 
对于Swift 3你可以使用
  cell.isUserInteractionEnabled = false 
对于Swift 3:
 cell.selectionStyle = .none