简体   繁体   English

如何在iphone中设置表格背景透明?

[英]How to set table background transparent in iphone?

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

cell.backgroundColor=[UIColor clearColor]

这对我来说很好。

table.backgroundColor = [UIColor clearColor]

马尔科

In iOS 6 seems this is not enough. 在iOS 6中似乎这还不够。 I have to set both, 我必须设置两个,

menuTable.backgroundColor = [UIColor clearColor];
if ([menuTable respondsToSelector:@selector(setBackgroundView:)]) { // only after 3.2
    [menuTable setBackgroundView:nil];
}
self.view.layer.backgroundColor = [UIColor clearColor].CGColor;

适用于iOS 9。

cell.backgroundColor = [UIColor clearColor];
cell.backgroundView = nil;
table.backgroundView = nil;

This works for me. 这适合我。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM