UITableView背景色iOS 9

我有一个UITableView,我想将其背景颜色设置为透明.表视图的背景颜色和界面构建器的所有子视图都设置为透明.它适用于iOS 8& 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]];

解决方法

Objective-C的:
[self.yourTableView setBackgroundColor:[UIColor clearColor]];

迅速:

self.yourTableView.backgroundColor = .clear

XCode 7.0错误.没有从Storyboard中获取

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...