在哪里可以获得特定于旋转的 appFrame?
如何检索旋转特定的应用程序框架/屏幕边界?在 iPad 上,“applicationFrame”方法始终返回 768x1024,无论设备处于横向还是纵向模式。我正在寻找一种方法,如果设备处于横向,则返回 1024x768,如果处于纵向,则返回 768x1024。
我确信那里有类似的东西,但我就是找不到它。如果它真的不存在,如何使您的 iPad 应用程序横向和纵向兼容?
How can I retrieve a rotation specific applicationFrame/screen bounds? The "applicationFrame" method always returns 768x1024 on the iPad, no matter whether the device is in landscape or portrait mode. I am looking for a method that would return me 1024x768 if the device is in landscape and 768x1024 if its in portrait.
I am sure there is something like this out there but I just can't find it. In case it really doesn't exist, how do make your iPad apps landscape and portrait compatible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将返回其中之一
从那里,您可以推断出当前帧应该是什么。
Will return one of
From there, you can deduce what the current frame should be.
事实证明,applicationFrame 工作正常,但前提是自动旋转正确实现!在我的例子中,作为子视图添加到 UIWindow 的视图的控制器被过早释放,这似乎导致 applicationFrame 与自动旋转机制一起中断。我认为这是因为响应者链无法再正常运行,但我没有验证这一点。
Turns out applicationFrame works fine, but only if the autorotation is properly implemented! In my case the controller of the view that was added as subview to the UIWindow was released too early, which seems to cause applicationFrame to break along with the autorotation mechanism. I think this is because the responder chain can no longer function properly, yet I did not verify this.