I have implemented the following code in order to change the tint of the section headers in a tableView. I just want to change the color tint, not to apply a view from my own. The app, however, seems to ignore it and the sections headers keep being displayed with the default gray. Any clue about what could I be doing wrong? Thanks a lot!
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
[[tableView headerViewForSection:section] setTintColor:[UIColor brownColor]];
return [tableView headerViewForSection:section];
}
this is work 100% and you can change your index or header text color
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
view.tintColor = [UIColor blueColor];
// if you have index/header text in your tableview change your index text color
UITableViewHeaderFooterView *headerIndexText = (UITableViewHeaderFooterView *)view;
[headerIndexText.textLabel setTextColor:[UIColor blackColor]];
}