开发者

UITableView Header / Footer is displaying

开发者 https://www.devze.com 2023-03-28 01:19 出处:网络
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

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

精彩评论

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