UITableView的节标题在iOS 7中不易识别.有没有办法在iOS 7中直接设置UITableView节标题颜色而不是创建新的UIView.

注意:我通过创建一个新的UIView找到了一些解决方案,
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)
但我真的想保留Apple的属性,除了颜色.没有这种方法,有没有办法做到这一点.
Wai*_*ain 52
实现tableView:willDisplayHeaderView:forSection:并更新您传递的视图.
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
UITableViewHeaderFooterView *v = (UITableViewHeaderFooterView *)view;
v.backgroundView.backgroundColor = [UIColor darkGrayColor];
}
Run Code Online (Sandbox Code Playgroud)
(假设您UITableViewHeaderFooterView在实现中提供了一个实例tableView:viewForHeaderInSection:)
| 归档时间: |
|
| 查看次数: |
15108 次 |
| 最近记录: |