A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

© zwcshy 中级黑马   /  2014-12-3 15:51  /  1024 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

本帖最后由 zwcshy 于 2014-12-3 15:52 编辑
  1. //方法一:
  2. cell.contentView.backgroundColor = [UIColor redColor];
  3. //方法二:
  4. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  5. UIView* bgview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)];
  6. bgview.opaque = YES;
  7. bgview.backgroundColor = [UIColor orangeColor];
  8. [cell setBackgroundView:bgview];
  9. //方法三:
  10. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  11. {
  12. cell.backgroundColor = [UIColor redColor];
  13. }
复制代码


0 个回复

您需要登录后才可以回帖 登录 | 加入黑马