我想设置我的UITableViewCells的细胞背景,但我挣扎着UIAccessoryView的背景颜色。它不会改变。细胞背景和配件
任何人都可以帮助我使背景颜色的UIAccessoryView透明(或实际上任何其他颜色)?
这是我的代码
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.accessoryView.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
if(indexPath.row % 2) {
cell.contentView.backgroundColor = [UIColor clearColor];
}
else {
cell.contentView.backgroundColor = [UIColor redColor];
}
这里是说明问题
太棒了!这是有效的,而且更容易!用渐变和'selectedBackgroundView'好主意非常感谢! – simonbs 2011-03-19 13:24:53
非常感谢......在这里呆了很久,你的回答是第一个解决它的问题。 :) – 2013-06-15 01:08:04
+1为好的答案,非常感谢。 – Shivaay 2014-02-24 06:38:15