以当前横向方向启动 iPad 应用程序
我的 iPad 应用程序只能横向运行。但当我在实际设备(而不是模拟器)上进行测试时,它似乎总是以一种特定的横向方向开始,然后旋转 180 度以匹配当前的物理横向方向。所以,它似乎从 LandscapeLeft 开始(我认为),然后旋转 180(如果我在 LandscapeRight 中有它)。 Info.plist 中没有任何内容可以设置初始方向。
任何人都可以建议一种在视图加载之前检测当前方向并在显示之前将其设置为正确的横向视图的方法吗?
谢谢菲托
My ipad app only runs in landscape orientation. But when I test on an actual device (not the simulator) it always seem to start in one particular landscape orientation, then turn 180 degrees to match the current physical landscape orientation. So, it seems to start in LandscapeLeft(I think) then rotate 180 if I have it in LandscapeRight. There's nothing in Info.plist to set the initial orientation.
Can anyone suggest a way to detect current orientation before view loads and set it to correct landscape view before showing?
Thanks
Fitto
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UIInterfaceOrientation~iPad
键可设置启动时的初始界面方向。还有
UISupportedInterfaceOrientations
键,它通知应用程序支持哪些方向。但是,无法使应用程序以 iPad 的当前方向启动。
There is the
UIInterfaceOrientation~iPad
key which sets the initial interface orientation on startup.There is also the
UISupportedInterfaceOrientations
key which informs the app which orientations are supported.There is no way, however, to make the app start in the current orientation of the iPad.
这些问题你调查过吗?
另外,从技术上讲,iPad 应该可以做到这一点。确保您已正确设置支持的方向,因为我确信它会检查这些方向以了解应该从哪里开始。
Have you looked into these questions?
Also, technically, the iPad should just do it. Make sure you have supported orientations set properly, as I'm sure it checks those to see where it should start.