uitableview setbackgroundcolor未在UITableViewStyleGrouped表中设置颜色

Ana*_*and 19 ios6

在iOS 6中

当表格样式为UITableViewStyleGrouped时,[uitableview setBackgroundColor:]不设置颜色

而是看到默认的条纹背景.

如果样式是UITableViewStyleGrouped,我们应该如何设置表的背景

Eri*_*lin 31

[tableViewInstance setBackgroundView: nil];
Run Code Online (Sandbox Code Playgroud)


Far*_*jes 19

设置

[tableView setBackgroundView: nil];
Run Code Online (Sandbox Code Playgroud)

在iOS 5中给我带来问题所以我使用的是:

UIView* bview = [[UIView alloc] init];
bview.backgroundColor = [UIColor yellowColor];
[tableView setBackgroundView:bview];
Run Code Online (Sandbox Code Playgroud)

iOS 5和6兼容!


Dav*_*idM 5

self.view.backgroundColor = TTSTYLEVAR(mainPageBackground);
self.tableView.separatorColor   = TTSTYLEVAR(mainPageBackground);
self.tableView.backgroundView = nil;
Run Code Online (Sandbox Code Playgroud)

为我修好了.你必须要小心这可能带来的其他影响.