2
votes

Issue:

If I send the app to the background when in UIInterfaceOrientationLandscapeRight orientation, when I resume the application from the multi-taskbar the orientation is UIInterfaceOrientationLandscapeLeft which is the default, for both the snapshot and view displayed. The view immediately re-orients itself by rotating back to the last known orientation before being suspended, UIInterfaceOrientationLandscapeRight.

Known Quantities:

  1. App supports 2 InterfaceOrientations: UIInterfaceOrientationLandscapeLeft and UIInterfaceOrientationLandscapeRight
  2. App utilizes auto-rotation all view controllers overriding ShouldAutoRotateToInterfaceOrientation, returning yes if the orientation is either of those supported
  3. Both orientations are defined within the Info.plist under the UISupportedInterfaceOrientations key
  4. When the app is sent to the background the automatic snapshot is taken and stored for the supported orientations
  5. Resuming the app from the springboard works as expected, the orientation is the same as when it was sent to the background.

Observed Behavior:

When resuming the app from the multi-taskbar, the app receives 2 orientation notifications which are respectively evaluated by the overridden shouldAutoRotateToInterfaceOrientation. First UIInterfaceOrientationLandscapeLeft, then UIInterfaceOrientationLandscapeRight.

Expected Results:

When resuming the app from the multi-taskbar, the orientation is the same as when it was suspended. So if we were in the UIInterfaceOrientationLandscapeRight mode, then I'd expect to resume with the same orientation.

1

1 Answers

0
votes

I know this is an old post, but the answer is that you are not defining the key UISupportedInterfaceOrientations in your Info.plist file with the values UIInterfaceOrientationLandscapeLeft and UIInterfaceOrientationLandscapeRight.