PageViewController overlapping NavigationItem and Toolbar

716 views Asked by At

I'm currently developing an app that uses Navigation Controller for main app flow. The app includes a scene (from Storyboard) where I wish to use a PageViewController.

It's all going well, except that I'd LIKE to make the PAGE CURL EFFECT of the pages overlap the navigationItem (at the top) and the Toolbar (at the bottom). Without this, the page curl effect is much less effective because because the page curl appears to be BEHIND the navigation chrome.

Any suggestions?

1

There are 1 answers

0
Abraham On

you can try to reduce the frame of the pageviewcontroller:

// Establish the page view controller
CGRect appRect = [[UIScreen mainScreen] applicationFrame];
pageController = [PageViewController pageViewWithDelegate:self];
CGRect reducedFrame = CGRectMake(appRect.origin.x, appRect.origin.y, appRect.size.width, (appRect.size.height - 44)); // here is the the reduction set for the toolbar of height 44
pageController.view.frame = (CGRect){.size = reducedFrame.size}; 

The view is still presented in the appRect, but the pageviewcontroller is presented in the reduced frame.

Hope this helps!

Abraham