如何设置UITableViewCell背景色

2025-04-23 22:54:05
推荐回答(2个)
回答1:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.backgroundColor = [UIColor redColor];
}

回答2:

cell.contentView.backgroundColor=[UIColor redColor];