Hi,
I've an app where I use a UITableViewHeaderFooterView and modify some of it's attributes like the textLabel's textColor. I dodn't exaclty know when this started but currently (iOS 10 beta 6) when a new UITableViewHeaderFooterView is created, the textLabel's textColor is black (when logged to console), but it's displayed in some kind of gray color.
And as soon as views get reused a different color gets logged to console. My delegate method is quite simple:
- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UITableViewHeaderFooterView* view = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"Header"];
view.contentView.backgroundColor = [UIColor defaultGroupTableViewBackgroundColor];
NSLog(@"%@", view.textLabel.textColor);
view.textLabel.textColor = [UIColor blackColor];
view.textLabel.text = [self tableView:tableView titleForHeaderInSection_:section];
return view;
}The problem is, when the view is created and it's textLabel's textColor is logged as black, the line 6 actually does nothing, because at that point the color is black already. But for some reason it is changed to
UIExtendedSRGBColorSpace 0.427451 0.427451 0.447059 1later somewhere between returning it from the delegate method and displaying it.
When a view gets reused the above color is logged and changing it to black now seems to work as the text becomes black for these header views.
Did anyone know whats going on?
Dirk