The viewForHeaderInSection's textLabel's textColor is always gray. BackgroundColor changes as expected. The following is the code creating the headerview. It does get in to the "!headerView" condition. Using ios sdk 7.1
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
static NSString *headerIdentifier = @"InspectionQuestionHeader";
UITableViewHeaderFooterView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:headerIdentifier];
if (!headerView) {
headerView = [[UITableViewHeaderFooterView alloc] initWithReuseIdentifier:headerIdentifier];
headerView.contentView.backgroundColor = [UIColor grayColor];
// Why doesn't this work?
headerView.textLabel.textColor = [UIColor whiteColor];
}
InspectionQuestionSection *questionSection = _questionSections[section];
NSString *title = [NSString stringWithFormat:@"%@. %@", questionSection.sectionNumber, questionSection.sectionDescription];
headerView.textLabel.text = title;
return headerView;
}