我需要一种方法来做到这一点。 我试过试试
-(BOOL) shouldAutorotate { return NO; }进入我的每个视图控制器,但是当我将设备倾斜到侧面时它仍然会自动旋转。
我为什么需要这个? 我们的合作伙伴之一有一个SDK,它要求我们支持其他方向(或者他们的应用程序崩溃)。
那么我该怎样做才能锁定我们的肖像模式并保持原样呢?
I need a way to do the above. I've tried putting
-(BOOL) shouldAutorotate { return NO; }into every one of my viewcontrollers, but it still autorotates when I tilt the device on its side.
Why do I need this? One of our partners has an SDK which requires us to support the other orientations (or else their app crashes).
So what can I do to lock our portrait mode in place and keep it like that?
最满意答案
不可能。 在iOS“支持”中,设备方向意味着当屏幕旋转到其他方向之一(而不是纵向)时,您的应用程序会重新调整大小并为该方向进行布局。 如果您想在纵向模式下保持锁定,请勿支持除肖像以外的任何其他内容。
I used a category to extend and override the UITabBarController, forcing autorotation off.
Check out this SO: UITabBarController Rotation Issues in ios 6
更多推荐
发布评论