在我的横向应用程序中,presentModalView 从侧面进入
我有一个 UIViewController,我想用 [selfpresentModalViewController:settingsControlleranimated:YES]
显示。
我的应用程序处于横向模式。当我使用 PresentModalViewController 时,视图从侧面滑入,就像在纵向模式下一样。当我使用 addSubview:
添加视图时,它会正确显示在屏幕上。
我确实在视图控制器中使用了shouldAutorotateToInterfaceOrientation,但它似乎对解决这个问题没有帮助。
- (BOOL)shouldAutorotateToInterfaceOrientation (UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
有没有人遇到过这个或者知道我可能哪里出了问题?
I have a UIViewController that I would like to show with [self presentModalViewController:settingsController animated:YES]
.
My application is in landscape mode. When I use presentModalViewController
the view slides in from the side as if it where in portrait mode. When I add the view using addSubview:
it appears on the screen correctly.
I do use shouldAutorotateToInterfaceOrientation
in my view controllers but it doesn't seem to help with this issue.
- (BOOL)shouldAutorotateToInterfaceOrientation (UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Has anyone run into this or know where I might have went wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试从主视图控制器而不是从子视图之一的控制器呈现模态视图。这对我来说很有效。
Try presenting the modal view from your main view controller and not from a controller of one of the subviews. That did the trick for me.