iOS11上废除了automaticallyAdjustsScrollViewInsets这个方法,所以造成iOS11机型顶端留白问题解决方法:if(@available(iOS 11.0,*)){self.tableview.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } else {self.automaticallyAdjustsScrollViewInsets = NO; } iOS11上对滚动视图加入了self-sizeing,默认如果不去实现viewForHeaderInSection就不会实现heightForHeaderInSection如果不实现上述方法,需要关闭自动估计高度self.tableView.estimatedRowHeight = 0; self.tableView.estimatedSectionHeaderHeight = 0; self.tableView.estimatedSectionFooterHeight = 0;
iOS11 Tableview顶部空白和Section Header留白问题
最新推荐文章于 2022-06-08 16:42:32 发布