ios|ios tableview顶部留白

iOS11上废除了automaticallyAdjustsScrollViewInsets

if (@available(iOS 11.0, *)) { self.mainView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; }else { self.automaticallyAdjustsScrollViewInsets = NO; }

iOS11上对滚动视图加入了self-sizeing,默认如果不去实现viewForHeaderInSection就不会调用heightForHeaderInSection
如果不实现上述方法,需要关闭自动估计高度
或者
self.mainView.estimatedRowHeight = 0; self.mainView.estimatedSectionHeaderHeight = 0; self.mainView.estimatedSectionFooterHeight = 0;

【ios|ios tableview顶部留白】@https://blog.csdn.net/leonliu070602/article/details/78581278

    推荐阅读