UIModalPresentationFullScreen 在 iPad 横向模式下无法正常工作?
我必须在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置 modelPresentationStyle UIModalPresentationCurrentContext。
也许它会解决你的问题。它解决了我的问题。
set the modelPresentationStyle UIModalPresentationCurrentContext.
may be it will solve your problem. it solved my problem.