Can you disable rotation globally in an iOS app? Can you disable rotation globally in an iOS app? ios ios

Can you disable rotation globally in an iOS app?


In Info.plist expand "Supported interface orientations" and remove Landscape items to make your application only run in portrait mode.


There are three kinds of Device orientation keys there in the info.plist now.

  1. Supported interface orientations (iPad)
  2. Supported interface orientations (iPhone)
  3. Supported interface orientations

Third one is I think for non-universal apps and rest two above are for iPad and iPhone.

You should give them a try.

enter image description here


After struggling to set in UIViewController's shouldAutorotate and supportedInterfaceOrientation methods, with no success in iOS6, I found the most effective is to set it in app delegate.

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{    return UIInterfaceOrientationMaskPortrait;}

However returning UIInterfaceOrientationMaskPortraitUpsideDown was crashing my app. I dont know whats wrong I was doing!


matomo