iphone - table view header problem
<p>I am trying to create a table view header with rounded corners but a gap is appearing on the top of the header view and I cannot get rid of it. See picture:
<img src="http://i.stack.imgur.com/5Ta2l.png" alt="alt text"></p>

<p>this is the code I have for the header</p>

<pre><code>#define HEADER_HEIGHT 35.0f


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
   return HEADER_HEIGHT;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {


   if (tableView.tableHeaderView) { // header was already created... go away
     return tableView.tableHeaderView;
   }

   CGFloat width = 300.0f;
   CGRect rectArea = CGRectMake(10.0f, 5.0f, width, HEADER_HEIGHT);

   tableView.tableHeaderView = [[[UIView alloc] initWithFrame:rectArea] autorelease];

   UIColor *orange =  [UIColor colorWithRed:(255.0f/255.0f) green:(228.0f/255.0f) blue:0.0f alpha:1.0f];

   [tableView.tableHeaderView setBackgroundColor:orange];

   rectArea = CGRectMake(10.0f, 5.0f, width, HEADER_HEIGHT);
   UILabel *lbl = [[UILabel alloc] initWithFrame:rectArea];
   lbl.text = NSLocalizedString(@"TGERAL", @"");
   lbl.textAlignment = UITextAlignmentLeft;
   lbl.font = [UIFont systemFontOfSize:13.0f];
   lbl.textColor = [UIColor blackColor];
   lbl.backgroundColor = [UIColor clearColor];
   lbl.numberOfLines = 2.0f;
   lbl.lineBreakMode = UILineBreakModeWordWrap;
   //[lbl sizeToFit];

   [tableView.tableHeaderView addSubview:lbl];
   [lbl release];

   self.tableView.tableHeaderView.layer.cornerRadius = 6.0f;

   return tableView.tableHeaderView;
}
</code></pre>

<p>If I change HEADER_HEIGHT or I add a certain amount of pixels to the height of the tableHeaderView or to the label height, all that happens is an increase in the gap.</p>

<p>Do you guys know what I am missing?</p>

<p>thanks</p>
