UITableView Header / Footer is displaying
Is there a way 开发者_StackOverflow中文版/ method of know if or when a table's header of footer will be displayed? Much like the tableView:willDisplayCell:forRowAtIndexPath:
method for cells, but for section headers/footers.
I would recomment you to use following UITableViewDelegate
's following methods:
– tableView:viewForHeaderInSection:
– tableView:viewForFooterInSection:
There are a lot more convenient methods in there, have a look!
About knowing when the view will appear:
You can return the desired view in viewForHeader/FooterInSecion
. That view's controller has it's own viewWillAppear
and viewDidAppear
in which you can do further code execution.
精彩评论