I need to place a button directly above a dynamically populated UIViewTable. It seems correct not to fill the first cell (row 0), but to use the header area, so I use the UITableViewDelegate method to programmatically create a UIView containing a UIButton:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0,0, 320, 44)] autorelease];
However, as shown below, the button is not set to the required space (I expected the header height to match argument 44).
What is wrong here? I must add that the UITableView is created in a separate XIB file.

iphone uitableview
maralbjo
source share