【发布时间】:2016-04-19 12:59:24
【问题描述】:
【问题讨论】:
标签: ios objective-c swrevealviewcontroller
【问题讨论】:
标签: ios objective-c swrevealviewcontroller
数据正在加载中。 iPad 将白色背景应用于单元格。
在你的侧边栏类中实现这个方法:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor clearColor];
}
如果您还没有为侧边栏 TableViewController 添加子类,则创建一个类SideBarTableViewController : UITableViewController。
好吧,有些人说这是一个错误,有些人说这是预期的行为,但我能找到的只是:
来自 Apple 文档 (UITableViewCell Class Reference):
... 在 iOS 7 中,单元格默认为白色背景;在早期版本的 iOS 中,单元格继承了封闭表格视图的背景颜色。如果要更改单元格的背景颜色,请在表格视图委托的 tableView:willDisplayCell:forRowAtIndexPath: 方法中进行。
【讨论】: