将NavigationController的NavigationBar半透明属性设置为false会导致额外的填充

时间:2014-12-30 18:52:39

标签: swift ios8 xcode6.1

在NavigationController的NavigationBar(以编程方式或通过StoryBoard)设置translucent = false属性时,根内容视图的顶部似乎有额外的填充。

我已经尝试调整滚动视图插图,但无济于事。 translucent = true不会导致此问题。

为什么会发生这种情况以及最简单的解决方法是什么?

1 个答案:

答案 0 :(得分:4)

啊,哈哈 - 最后到达那里。当使用半透明导航栏时,您需要确保所有视图控制器上的adjusts scroll view insetsextend edges under opaque bars都设置为true

以下是StoryBoard设置:

enter image description here