Iphone UITableView组样式单元格背景

Iphone UITableView组样式单元格背景,iphone,uitableview,Iphone,Uitableview,我的问题很简单 如何去除组样式中单元格的白色背景色 我知道clearColor,但它只是清除tableview本身的背景色,而不是单元格的背景色 提前感谢。有一个。对于普通stye表格视图,这通常设置为nil,但对于分组表格视图,则不是。试试这个: if ([ cell backgroundView] != nil ) { [[cell backgroundView] setBackgroundColor:[UIColor redColor]]; } else { // Crea

我的问题很简单

如何去除组样式中单元格的白色背景色

我知道clearColor,但它只是清除tableview本身的背景色,而不是单元格的背景色

提前感谢。

有一个。对于普通stye表格视图,这通常设置为
nil
,但对于分组表格视图,则不是。试试这个:

if ([ cell backgroundView] != nil ) {
    [[cell backgroundView] setBackgroundColor:[UIColor redColor]];
} else {
    // Create a view, set its frame to the cell's frame, and set its background
    // color.
}

如果单元格位于分组表视图中,该代码会将其背景颜色设置为红色。

第一部分不起作用。因此,我删除了if语句,“else”部分就像一个符咒。谢谢。