2012-04-15 121 views
0

我已经搜索周围,看到各种答案,但尚未解决我的问题在这里。我试图将我的UITableViewCell背景颜色设置为白色以外的其他颜色。我有更改表格单元格背景颜色

cell.contentView.backgroundColor = [UIColor colorWithRed:0.949 green:0.949 blue:0.949 alpha:1.0]; 

但这并不改变accesoryView的背景颜色,我目前的披露指标。我曾尝试过:

cell.accessoryView.backgroundColor = [UIColor colorWithRed:0.949 green:0.949 blue:0.949 alpha:1.0]; 

无济于事。我也尝试将其设置为清晰并与其他背景颜色相混淆。我在这里错过了什么?这似乎是一个简单的修复。

回答

0

嗯,这不可能是任何容易...

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 
    cell.backgroundColor = [UIColor colorWithRed:0.949 green:0.949 blue:0.949 alpha:1.0]; 
} 

新手的错误,显然。

相关问题