0

viewForHeaderInSection is not getting called on reloadData. How ever it is getting called first time when the view is loaded. Very strange. Any help?I've implemented the below delegate methods.

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0;
}

-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section
{
    return 1500.0f;
}

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

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {}
Kosuke Ogawa
  • 7,383
  • 3
  • 31
  • 52

1 Answers1

0

Your heightForHeaderInSection probably return 0 because UITableViewAutomaticDimension does not work. In order to make UITableViewAutomaticDimension work you have to set all left, right, bottom, and top constraints relative to cell container view.

Kosuke Ogawa
  • 7,383
  • 3
  • 31
  • 52