为不同的列设置间隔颜色(alternate color ),可以方便用户观看app的内容,在UTTableView中设置间隔颜色需要重写下面的willDisplayCell:forRowAtIndexPath方法

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {

    if( [indexPath row] % 2) {

        [cell setBackgroundColor:[UIColorwhiteColor]];

    }

    else {

        [cell setBackgroundColor:[UIColorgrayColor]];

    }

}

相关文章:

  • 2021-11-12
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-07-21
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案