在开发中我们经常要会遇到要给UITableView分组加头视图和尾视图,这时如果要使用UITableViewStylePlain,头视图就会在上面悬停,但是我们又不想要这个悬停效果,这时我们只有使用UITableViewStyleGrouped,但是UITableViewStyleGrouped有默认背景颜色,但是我们的需求psd要的又不是这种背景颜色,这时我们可以设置UITableView背景颜色设为clearColor,或者给UITableView的backgroundView设置背景颜色
UIView *tablebackgroundView = [[UIView alloc] initWithFrame:tableView.frame];
tablebackgroundView.backgroundColor = RGB(247, 247, 247);
tableView.backgroundView = tablebackgroundView;