【发布时间】:2015-11-01 10:39:09
【问题描述】:
我有一个 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]];
【问题讨论】:
-
首先,这不是一个好主意,因为滚动性能会受到影响。除此之外,我认为这是一个错误。归档雷达。
-
必须尝试
cell.contentView.backgroundColor吗?在报告之前尝试再挖掘一点..嗯..我也认为这是一个错误。
标签: ios objective-c xcode uitableview ios9