OGeek|极客世界-中国程序员成长平台

标题: ios - willDisplayHeaderView 未在 TableViewController 中调用 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 13:37
标题: ios - willDisplayHeaderView 未在 TableViewController 中调用

为什么在 TableViewController 中没有调用 willDisplayHeaderView?

- (void)tableViewUITableView *)tableView willDisplayHeaderViewnonnull UIView *)view forSectionNSInteger)section
{
  //
}

编辑:

和heightForHeaderInSection

- (CGFloat)tableViewUITableView *)tableView heightForHeaderInSectionNSInteger)section
{
  //
}

弃用?

XCODE 版本 9.0 beta 5 (9M202q)



Best Answer-推荐答案


谢谢克鲁纳尔!您的评论针对 iOS 11 修复了它(早期的 iO​​S 版本没有任何问题)

- (UIView *)tableViewUITableView *)tableView viewForHeaderInSectionNSInteger)section
{
  return myView;
}

关于ios - willDisplayHeaderView 未在 TableViewController 中调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45737467/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4