Formatting of titleforHeaderInSection is not working
I am trying to change the colour of the headers for sections in my grouped tableview. I am using the following code;
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
{
NSString *headerText = [[plistFileName objectAtIndex:section]objectForKey:@"Header"];
UILabel *sectionHeader = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 40)] autorelease];
sectionHeader.backgroundColor = [UIColor clearColor];
sectionHeader.font = [UIFont boldSystemFontOfSize:10];
sectionHeader.textColor = [UIColor whiteColor];
sectionHeader.text = headerText;
return headerText;
}
The headers are displayed for each section, but they are not showing the features that i have defined above in the UILabel (e.g. white in color and size 10 Font) - which makes me wonder whether the UILable code is being recognised?
What do i need to do to correct this?
j
macbook, Mac OS X (10.6.4)