I have an app which is 99 % portrait only, just one viewcontroller is in landscape. Therefore my Info.plist
contains three possible orientations: Portrait and both Landscape.
Everything works fine, except: when I bring my app to the background and to the front again, the status bar (and, if showing, the keyboard) rotate to landscape when I rotate the device. My views remain correct.
Is this a bug or am I missing something?
You can try implementing
application:supportedInterfaceOrientationsForWindow:
in your App Delegate.From Apple docs:
You can then add something like this (assume your just-one-landscape-controller is MyLandscapeOnlyViewController):
Objective-C
Swift 3
The inspection of the topmost presented ViewController might be more challenging depending on your view hierarchy but this is the general idea.
Hope this helps!