2

我是 iphone 开发的新手。我在分组表视图中显示了内容列表。如何设置表背景透明,例如我应该看到显示在灰色(默认颜色)背景而不是白色背景上的文本颜色。请帮帮我。谢谢。

4

6 回答 6

11
cell.backgroundColor=[UIColor clearColor]

这对我来说很好。

于 2010-08-20T02:58:12.740 回答
3
table.backgroundColor = [UIColor clearColor]

马可

于 2010-02-13T12:00:39.427 回答
1
cell.backgroundColor = [UIColor clearColor];
cell.backgroundView = nil;
table.backgroundView = nil;

这对我有用。

于 2016-09-08T10:11:50.497 回答
0

在 iOS 6 中,这似乎还不够。我必须同时设置,

menuTable.backgroundColor = [UIColor clearColor];
if ([menuTable respondsToSelector:@selector(setBackgroundView:)]) { // only after 3.2
    [menuTable setBackgroundView:nil];
}
于 2013-02-18T15:33:48.413 回答
0
self.view.layer.backgroundColor = [UIColor clearColor].CGColor;

适用于 iOS 9。

于 2016-09-08T07:49:21.397 回答
-3

UITableView 从 UIView 继承了一个 'alpha' 属性,所以尝试改变它:)

于 2010-02-13T11:52:22.003 回答