IOS 5静态tableview单元格没有背景颜色

时间:2012-07-11 14:48:44

标签: ios uitableview

我正在尝试使表格单元格完全透明。我在iOS 5中使用静态表格单元格并尝试更改以清除颜色,但它确实

我甚至尝试过(在viewDidLoad中)

self.tableView.backgroundColor = [UIColor clearColor];

但是整个桌子是黑色的,细胞是白色的。 (见照片)enter image description here

3 个答案:

答案 0 :(得分:4)

试试这个

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell           
forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor clearColor];
}

答案 1 :(得分:2)

self.tableView.backgroundColor = [UIColor clearColor] - 将更改tableview的背景颜色而不是单元格。

尝试在Interface Builder中选择单个单元格,然后使用检查器将单元格背景更改为颜色或不透明。

答案 2 :(得分:1)

在cellForRowAtIndexPath中尝试[cell setOpaque:FALSE]和[cell setBackgroundColor:[UIColor clearColor]]:

相关问题