PageViewController 重叠 NavigationItem 和工具栏

发布于 2024-12-26 23:34:05 字数 199 浏览 1 评论 0原文

我目前正在开发一个使用导航控制器作为主应用程序流程的应用程序。该应用程序包含一个场景(来自 Storyboard),我希望在其中使用 PageViewController。

一切都很顺利,只是我想让页面的页面卷曲效果与导航项(顶部)和工具栏(底部)重叠。如果没有这个,页面卷曲效果的效果就会大大降低,因为页面卷曲似乎位于导航镶边的后面。

有什么建议吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水染的天色ゝ 2025-01-02 23:34:05

您可以尝试缩小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呈现在缩小的框架中。

希望这有帮助!

亚伯拉罕

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文