I’m trying to create my own section header for my grouped cells. When I create it, using the following code, it looks as if the bounds are off. More specifically the height of the CGRect

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *header = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 50)] autorelease];
[header setBackgroundColor:[UIColor clearColor]];
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(10, 3, tableView.bounds.size.width, 18)] autorelease];
label.textColor = [UIColor redColor];
label.text = @"SOME TEXT";
label.backgroundColor = [UIColor clearColor];
[header addSubview:label];
return header;
}
Any idea why the height is off? Am I missing something?
Have you also implemented
tableView:heightForHeaderInSection:as described in the docs? This should return 50 for your table.