Hi,
I use a UIView with a UILabel for table section headers (code below). It looks fine in the simulator and on the iphone. But on an iPad (snapshot attached), the headers are all scrunched. Any advice on what we are doing wrong would be greatly appreciated.
Code:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, 300, 44)];
UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.opaque = NO;
headerLabel.textColor = [UIColor whiteColor];
headerLabel.highlightedTextColor = [UIColor whiteColor];
headerLabel.font = [UIFont boldSystemFontOfSize:20];
headerLabel.frame = CGRectMake(20, 0, 500, 44);
headerLabel.text = section==EQUITY_SECTION?@"Stocks, ETF's, Mutual Funds"
:section==CASH_SECTION?@"Cash"
:@"Benchmarks to be used in report";
[customView addSubview:headerLabel];
return customView;
}