gpt4 book ai didi

ios - UITableView 背景色 iOS 9

转载 作者:可可西里 更新时间:2023-11-01 03:08:50 25 4
gpt4 key购买 nike

我有一个 UITableView,我想将其背景颜色设置为透明。 TableView 和界面生成器中所有 subview 的背景颜色设置为透明。它适用于 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]];

swift :

self.yourTableView.backgroundColor = .clear

XCode 7.0 错误。不从 Storyboard 中获取

关于ios - UITableView 背景色 iOS 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31903910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com