0

我希望更改XLForm中某个部分(或表单)的BackgroundColor 。


部分 - 多值行模板。

section.multivaluedRowTemplate.cellConfig[@"backgroundColor"] = kBackgroundColor;


用一排

row.cellConfigAtConfigure[@"backgroundColor"] = kBackgroundColor;

4

1 回答 1

0

感谢@mats-claassen 在 GitHub 上的回复


代码

- (void)viewDidLoad {
    [[self tableView] registerClass:[UITableViewHeaderFooterView class] forHeaderFooterViewReuseIdentifier:@"headerFooterReuseIdentifier"];
}

标题

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UITableViewHeaderFooterView *headerFooterView = [[self tableView] dequeueReusableHeaderFooterViewWithIdentifier:@"headerFooterReuseIdentifier"];
    headerFooterView.contentView.backgroundColor = kBackgroundColor;

    return headerFooterView;
}

页脚

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UITableViewHeaderFooterView *headerFooterView = [[self tableView] dequeueReusableHeaderFooterViewWithIdentifier:@"headerFooterReuseIdentifier"];
    headerFooterView.contentView.backgroundColor = kBackgroundColor;

    return headerFooterView;
}
于 2017-04-05T13:32:10.700 回答