方案1:
在- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath加 cell.selectionStyle = UITableViewCellSelectionStyleNone;
注意:该方案是彻底干掉灰色背景
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.imageView.image = [UIImage imageNamed:self.meImgsArr[indexPath.section][indexPath.row]];
cell.textLabel.text = self.meDataSource[indexPath.section][indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
方案二:修改- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
方法中加[tableView deselectRowAtIndexPath:indexPath animated:NO];
注意:该方案是抬手以后没有灰色背景
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];
}