Why - (void) tableView: (UITableView *) tableView willDisplayHeaderView: (UIView *) view forSection: (NSInteger) section not called

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
    [view vChangeBackgroundToCyan];
}

after

[self.delegateForTableController.tvDelegated insertSections:[NSIndexSet indexSetWithIndex:ip.section] withRowAnimation:UITableViewRowAnimationRight];

And what do you call them?

+4
source share
2 answers

The class returned by tableView: viewForHeaderInSection: must be a subclass of UITableViewHeaderFooterView for tableView: willDisplayHeaderView: forSection: method to call.

If the returned view is of any other type, the tableView: willDisplayHeaderView: forSection: method will not be called.

+7
source

As far as I know, - tableView:willDisplayHeaderView:forSection:only called if you provide your own view in – tableView:viewForHeaderInSection:.

, nil.

0

Source: https://habr.com/ru/post/1530722/


All Articles