开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜