我目前正在开发一个将导航控制器用于主要应用程序流程的应用程序。该应用程序包含一个我希望使用 PageViewController 的场景(来自 Storyboard)。
一切顺利,除了我想让页面的 PAGE CURL EFFECT 与 navigationItem(在顶部)和 Toolbar(在底部)重叠。没有这个,页面卷曲效果就没有那么有效了,因为页面卷曲似乎在导航镶边的后面。
有什么建议么?
我目前正在开发一个将导航控制器用于主要应用程序流程的应用程序。该应用程序包含一个我希望使用 PageViewController 的场景(来自 Storyboard)。
一切顺利,除了我想让页面的 PAGE CURL EFFECT 与 navigationItem(在顶部)和 Toolbar(在底部)重叠。没有这个,页面卷曲效果就没有那么有效了,因为页面卷曲似乎在导航镶边的后面。
有什么建议么?
您可以尝试减少 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};
视图仍然呈现在 appRect 中,但 pageviewcontroller 呈现在缩小的框架中。
希望这可以帮助!
亚伯拉罕