UIModalPresentationFullScreen 在 iPad 横向模式下无法正常工作?

发布于 2024-12-26 02:53:19 字数 663 浏览 5 评论 0原文

我必须在 modalViewController iPad 中显示数据。我必须将 viewController1 中的 viewController2 呈现为 ModalView 以实现全屏。 viewController1位于UITabbarController中,viewController2应该隐藏tabBar。因此,我使用此代码从 viewController1 显示 viewController2,

UIViewController *viewController2=[[UIViewController alloc] init];        
viewController2.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController: viewController2 animated:YES];

当我在横向模式下调用此 viewController2 时,viewController 显示 viewController1 中屏幕的一半。而且,模拟器会自动切换到纵向模式并自动返回到横向模式。这里面有什么问题呢?谁能帮我找到解决方案吗?提前致谢。

I have to show the data in modalViewController iPad. I have to present the viewController2 from viewController1 as ModalView for full screen. The viewController1 is in UITabbarController, the viewController2 should be hide the tabBar. So, i used this code to show the viewController2 from viewController1,

UIViewController *viewController2=[[UIViewController alloc] init];        
viewController2.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController: viewController2 animated:YES];

When i call this viewController2 in Landscape mode, the viewController shows half of the screen in viewController1. And also, the simulator automatically change to Portrait and automatically return to Landscape mode. What is the problem in this? Can anyone please help me to find the solution? Thanks in advance.

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

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

发布评论

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

评论(1

骷髅 2025-01-02 02:53:19

设置 modelPresentationStyle UIModalPresentationCurrentContext。
也许它会解决你的问题。它解决了我的问题。

set the modelPresentationStyle UIModalPresentationCurrentContext.
may be it will solve your problem. it solved my problem.

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