Reputation: 175
In my App I'm using a visually customized NavigationController to handle the page flow.
By default the Navigationbar appears on top and the content of the viewcontroller just below it. However what I'd like to achieve is that the actual content of the viewcontroller starts at the top of the screen and not below the navigationbar.
So at the moment it looks like (the green is the navigationbar):
And I want the green to be overlapping the viewController, I checked all the navigationbar bools but I can't find the right property.
Any help would be appreciated
Upvotes: 3
Views: 4770
Reputation: 1923
You probably want to check the value of your view controller's edgesForExtendedLayout property, and that the extendedLayoutIncludesOpaqueBars property is set to true (because your navigation bar looks to be opaque). Assuming you're using Swift it can be achieved like so:
// This is the default value of edgesForExtendedLayout
controller.edgesForExtendedLayout = .All;
// The default for this is false
controller.extendedLayoutIncludesOpaqueBars = true;
The comments on your question about automaticallyAdjustsScrollViewInsets
in regards to UIScrollView are also worth looking into if you're using that class.
Upvotes: 5