我有一个分组的tableView,现在想将默认背景改成自定义颜色。我已经搜索了很多,最接近的方法是这样的:
- (void)viewDidLoad {
UIColor *backgroundColor = [UIColor colorWithRed:181 green:293 blue:223 alpha:0];
self.tableView.backgroundView = [[UIView alloc]initWithFrame:self.tableView.bounds];
self.tableView.backgroundView.backgroundColor = backgroundColor;
}
这段代码将背景更改为白色,但我无法将其更改为自定义颜色。有人可以帮忙吗?