Setting NavigationController's NavigationBar t

2019-09-03 15:51发布

There appears to be extra padding at the top of the root content view when the translucent = false property is set on the NavigationController's NavigationBar (programatically or via the StoryBoard).

I've tried adjusting the scroll view insets but to no avail. translucent = true doesn't cause this problem.

Any ideas why this is happening and what the easiest way to resolve it is?

1条回答
唯我独甜
2楼-- · 2019-09-03 15:59

Ah-ha - got there in the end. When not using a translucent navigation bar you need to ensure that both adjusts scroll view insets and extend edges under opaque bars are set to true on all your view controllers.

Here are the StoryBoard settings:

enter image description here

查看更多
登录 后发表回答