UITableView背景色iOS 9

UITableView背景色iOS 9,ios,objective-c,xcode,uitableview,ios9,Ios,Objective C,Xcode,Uitableview,Ios9,我有一个UITableView,我想将其背景色设置为透明。interface builder中表格视图和所有子视图的背景色设置为透明。它适用于iOS 8和iOS 7。但是,不是iOS 9。有什么想法吗 cellForRowAtIndexPath方法: [cell setSelectedBackgroundView:[[UIView alloc] init]]; [cell.selectedBackgroundView setBackgroundColor:[UIColor clearColor]

我有一个UITableView,我想将其背景色设置为透明。interface builder中表格视图和所有子视图的背景色设置为透明。它适用于iOS 8和iOS 7。但是,不是iOS 9。有什么想法吗

cellForRowAtIndexPath方法:

[cell setSelectedBackgroundView:[[UIView alloc] init]];
[cell.selectedBackgroundView setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundColor:[UIColor clearColor]];
[cell.contentView setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundView:[[UIView alloc] init]];
[cell.backgroundView setBackgroundColor:[UIColor clearColor]];
[self.yourTableView setBackgroundColor:[UIColor clearColor]];
self.yourTableView.backgroundColor = .clear

目标-c:

[cell setSelectedBackgroundView:[[UIView alloc] init]];
[cell.selectedBackgroundView setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundColor:[UIColor clearColor]];
[cell.contentView setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundView:[[UIView alloc] init]];
[cell.backgroundView setBackgroundColor:[UIColor clearColor]];
[self.yourTableView setBackgroundColor:[UIColor clearColor]];
self.yourTableView.backgroundColor = .clear
Swift:

[cell setSelectedBackgroundView:[[UIView alloc] init]];
[cell.selectedBackgroundView setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundColor:[UIColor clearColor]];
[cell.contentView setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundView:[[UIView alloc] init]];
[cell.backgroundView setBackgroundColor:[UIColor clearColor]];
[self.yourTableView setBackgroundColor:[UIColor clearColor]];
self.yourTableView.backgroundColor = .clear

XCode 7.0错误。不从情节提要中拾取

即使在代码中创建UITableView并将其设置为UIViewController的私有属性时,我也会遇到这种情况。但是,如果UITableView是全局变量,则不会出现此问题


我怀疑苹果正在我的UIViewController上的IVAR上扎根,未经我的请求就将UITableView的背景色设置为UIColor whiteColor。我已经检查过了,要执行的调用将通过UITableView上的setBackgroundColor进行。

首先,这不是一个好主意,因为滚动性能会受到影响。除此之外,我认为这是一个错误。文件a雷达。是否尝试过
cell.contentView.backgroundColor
?在报告之前,再多挖一点。。隐马尔可夫模型。。我还认为这是一个bug。是的,我以前就发现了。这个bug在beta 5中还存在吗?你试过了吗?对不起,我没有试beta 5。@hasan83是的,这仍然是beta 5中的一个bug。我对约束有类似的问题-对于某些屏幕,它们只是消失了。