Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 自动布局中的未解释边距_Ios_Autolayout - Fatal编程技术网

Ios 自动布局中的未解释边距

Ios 自动布局中的未解释边距,ios,autolayout,Ios,Autolayout,真的很简单。我有一个包含蓝色视图的黄色滚动视图。在xib中,我将蓝色视图设置为完全填充其父视图scrollView,方法是将其所有边框与0偏移匹配: 然而,在执行过程中: 在这一点上,我已经将代码剥离到严格的最低限度,以隔离错误的原因,我的代码中没有留下任何东西。我尝试将TranslatesAutoReshizingMaskintoConstraints设置为NO,并为所有视图调用layoutIfNeeded,它不会改变任何东西。你们知道顶部的空间是从哪里来的吗?内容插图受导航栏高度的影响

真的很简单。我有一个包含蓝色视图的黄色滚动视图。在xib中,我将蓝色视图设置为完全填充其父视图scrollView,方法是将其所有边框与0偏移匹配:

然而,在执行过程中:


在这一点上,我已经将代码剥离到严格的最低限度,以隔离错误的原因,我的代码中没有留下任何东西。我尝试将TranslatesAutoReshizingMaskintoConstraints设置为NO,并为所有视图调用layoutIfNeeded,它不会改变任何东西。你们知道顶部的空间是从哪里来的吗?

内容插图受导航栏高度的影响

尝试设置self.automaticallyAdjustsScrollViewInsets=NO

这也可以通过“调整滚动视图插入”在故事板中设置