【发布时间】:2014-02-26 19:48:26
【问题描述】:
一种方法是使用
tableView:viewForHeaderInSection:
但是,这意味着我必须提供自己的headerView。
我想要普通的标准headerView。
我只想更改background color。
我该怎么做?
【问题讨论】:
标签: objective-c uitableview background-color
一种方法是使用
tableView:viewForHeaderInSection:
但是,这意味着我必须提供自己的headerView。
我想要普通的标准headerView。
我只想更改background color。
我该怎么做?
【问题讨论】:
标签: objective-c uitableview background-color
来自 UITableViewDelegate 协议的结帐方法:
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section;
这里你得到了将要显示的标题视图(view)。
可能是这样的:
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
[view setBackgroundColor:[UIColor redColor]];
}
【讨论】: