Finally, I was able to correctly align the built-in UIPageViewController in the NavController, which itself is inside the TabBarcontroller. I did this by programmatically creating a pageViewController inside a dummy “rootviewcontroller”, following the example specified in the standard Xcode “New Project” called “Page Based Application”.
In my case, the following layout layout generates an error: TabBarController -> NavController -> UIPageViewController (scroll-horizontal) -> ContentViewController
I changed the layout of the layout: TabBarController -> NavController -> CustomRootViewController
CustomRootViewController creates an instance of UIPageViewController and saves it as a member property. CustomRootViewController becomes a DataSource and Delegate for its PageViewController. Follow the standard Xcode “New Project” called “Page-based Application” for an example of how to configure RootViewController.
Unfortunately, this whole problem is caused by an error in the Storyboard when you use the "UIPageViewController" with drag and drop horizontally, built into navController (and / or tabbarcontroller). FYI. In the pageViewControllerWillAppear view, I tried to reset the frame on the ViewController page and the contentViewControllers each at (0,0) with the size corresponding to the device, and yet the initial viewController pageViewController view will always be reset by what appeared to be the height of the tabbarcontroller in which it was embedded. Here are a few notes for those who want to continue this question:
In viewDidLoad, you can set Frame from the initial pageViewController to offset the layout error. But then you may have to deal with various layout adjustments for different devices in different orientations, and this can be a headache along the way.
In Storyboard, setting the pageViewController transition style to "page freeze" fixes a layout problem. Therefore, I am sure that the layout problem is in the scroll page that is set when the instance is created. Creating a Storyboard object will result in a layout error, but the software implementation in my CustomRootViewController will be error free.
source share