- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"activityTableViewCell";
    activityTableViewCell *cell = (activityTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
         cell = [[activityTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    
    cell.selectionStyle=UITableViewCellSelectionStyleNone;//设置cell点击效果
    
    return cell;
}

  或者

//重写 cell 点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
    //当离开某行时,让某行的选中状态消失
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

  

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
  • 2021-07-22
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案