Navigation Topics - YamamotoDesu/Yamamoto-Notes GitHub Wiki

1. How to remove extra space between the Navigation Bar and the Scroll View?

Why the current issue is there

From iOS 7 to iOS 10, when we add a Navigation Bar on top of any ViewController, then Xcode provides us an option to make the Navigation bar translucent. So that we can see through the Navigation Bar and the scrolling of the page can be seen through the navigation bar.

Now the reason for the issue is that when a Scroll View is added in the ViewController and Navigation Bar is set and translucent, the ScrollView leaves a margin from the main view for navigation bar. But the navigation bar added on the run time and it moves the main view downed so that Navigation Bar can fit on the top.

Set the Translucent option for Navigation Bar to “False”

Set the Scroll Edge option for the Appearance to “True”

Now run your app


2. NavigationBarButtons