1

我有一个自定义单元格(不使用 xib),我正在尝试更改附件视图的背景颜色。这是我的代码和我尝试过的“

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    customCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID" forIndexPath:indexPath];

    cell.accessoryView.backgroundColor = [UIColor redColor];

    return cell;
}

结果:

背景颜色没有改变。

4

1 回答 1

1

您可以通过以下两种方式中的任何一种来执行此操作。您可以更改表格视图的色调颜色,这将更改附件的颜色,或者您可以拖动任何您想要的视图或控件,并将其颜色更改为您想要的任何颜色。

于 2015-02-02T00:45:16.113 回答