UPDATE
Based on Tim's answer, I implemented the following in every view controller that had a scrollview (or subclass) that was part of my custom container:
- (void)didMoveToParentViewController:(UIViewController *)parent { if (parent) { CGFloat top = parent.topLayoutGuide.length; CGFloat bottom = parent.bottomLayoutGuide.length;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have a custom container view controller named SegmentedPageViewController . I set this as the UINavigationController rootViewController .
The purpose of the SegmentedPageViewController is to allow the UISegmentedControl , specified as the header header of the NavController, to switch between different child view controllers.

All of these child view controllers contain either a scrollview, a tableview, or a collection.
We find that the first view controller loads normally, correctly located under the navigation bar. But when we switch to the new view manager, the navigation bar is not respected, and the view is set under the navigation bar.

We use automatic layout and interface builder. We have tried everything that we can think of, but cannot find an agreed solution.
Here is the main block of code responsible for setting up the first view controller and switching to another when the user clicks on the segmented control:
- (void)switchFromViewController:(UIViewController *)oldVC toViewController:(UIViewController *)newVC { if (newVC == oldVC) return;
ios objective-c ios7 uinavigationbar
djibouti33 Sep 26 2018-12-21T00: 00Z
source share