I have a plain UITableView in my project with sectioned data. For each section I have a header for every letter so it looks like the contacts app on the iPhone. The only thing I want to change, however, is the color of the header background. This code doesn't work but this is what I want to achive:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[[UITableView alloc] init] tableHeaderView];
[headerView setBackgroundcolor:[UIColor redColor]];
return headerView;
}
I could design my headerView from scratch by initing a UIView and building it to look like the header does now, but then I need to write much more code and have to guess the properties since I don't know what the code for a regular header is and since I just want to change the background color I thought there might be an easier way.
Thanks!