我正在尝试设置我的 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];
}
这是说明问题的图像