方法1
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
[cell setUserInteractionEnabled:enabled];
方法2
为了彻底避免UITableViewCell选择,让UITableViewDelegate实现tableView:willSelectRowAtIndexPath:。如果你不希望选中行,从那个函数可以返回nil
- (NSIndexPath *)tableView:(UITableView *)tv willSelectRowAtIndexPath:(NSIndexPath *)path
{
return nil;
}
网友评论