解决 iOS6 中 tableview 背景设置问题

2013-02-19

iOS6 之前版本给 tableview 设置背景只需如下:

self.tableView.backgroundColor = [UIColor redColor];

iOS6 却无效。

然后,查阅了神站 stackoverflow

UIView* bview = [[UIView alloc] init];
bview.backgroundColor = [UIColor yellowColor];
[tableView setBackgroundView:bview];

为了适应各种系统。 又要写一堆的 if .... else 了