- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if(section != 0) {
UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 30)] autorelease];
view.backgroundColor = [UIColor redColor];
return view;
} else {
return tableView.tableHeaderView;
}
}
This is my implementation of viewForHeaderInSection but whatever frame I make it's always showing me the same red frame. Do you see any problem with my code?
Can't post the picture because of my rep but here is the link ;-)
http://img638.imageshack.us/img638/3350/bildschirmfoto20100315uq.png
UPDATE:
Mhm now my red block is higher but my first tableHeader is now somehow hidden. The first one was implemented with the titleForHeaderInSection. I thought I just implement the height of the tableHeader height but that doesnt work
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if(section == 1)
return 30;
else
return tableView.tableHeaderView.frame.size.height;
}