<分区>
Possible Duplicate:
How can I disable the UITableView selection highlighting?
当您点击 UITableView
中的一行时,该行会突出显示并被选中。是否可以禁用此功能以便点击一行什么都不做?
<分区>
Possible Duplicate:
How can I disable the UITableView selection highlighting?
当您点击 UITableView
中的一行时,该行会突出显示并被选中。是否可以禁用此功能以便点击一行什么都不做?
最佳答案
是的,下面的代码将禁用用户交互,如果您只想禁用某些特定的单元格,您需要编写一些 if - else 方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.userInteractionEnabled = NO;
return cell;
}
关于iphone - 编辑时iPhone UITableViewCell selectionStyle中的selectionStyle?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14262796/