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 {}
Your
heightForHeaderInSection
probably return0
becauseUITableViewAutomaticDimension
does not work. In order to makeUITableViewAutomaticDimension
work you have to set all left, right, bottom, and top constraints relative to cell container view.