I want to change the height, tableHeader font, etc ...
I implemented UITableViewDelegate , UITableViewDataSource and added heightForHeaderInSection and viewForHeaderInSection . But these two methods are not called. Other methods like numberOfRowsInSection / cellForRowAtIndexPath work fine. I see a table, but without a title :(
Any idea?
here is the code:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.poHeader.itemList count]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { NSLog(@"numberOfSectionsInTableView"); return 1; } -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ NSLog(@"*******height"); return 44.0; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { NSLog(@"***in viewForHeader In section"); UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(2, 166, 300.0, 44.0)]; UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; headerLabel.backgroundColor = [UIColor clearColor]; headerLabel.opaque = NO; headerLabel.textColor = [UIColor blackColor]; headerLabel.highlightedTextColor = [UIColor whiteColor]; headerLabel.font = [UIFont systemFontOfSize:13]; headerLabel.frame = CGRectMake(2, 166, 300.0, 44.0); headerLabel.text = @"Part No. Description Ext Cost";
source share