在viewController中添加scrollView并铺满全屏,隐藏导航条,设置scrollView上下左右间距为0,此种情况上部会留出状态栏高度,iPhone X上下部会留出34,都无法铺满全屏
解决如下:
if (@available(iOS 11.0, *)) {
self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}else{
self.automaticallyAdjustsScrollViewInsets = NO;
}