In XCode4.2 + iOS5 SDK, I set "Supported Device Orientation" to be "Portrait" only. I expect that would make all views in the application to only support "Portrait" orientation. However, while I rotate the iPhone simulator, I found that other orientations still work.
It seems that the method shouldAutorotateToInterfaceOrientation in ViewController is the key to decide whether given orientation is supported. So, why bother to have "Supported Device Orientation" setting in the application level if doesn't limit orientation?
On an iPhone, when you tilt your device on its side, the screen follows and rotates to landscape orientation. Turning on portrait orientation locks the screen so that no matter which way your iPhone is turned, the screen will stay in place.
Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off.
Here's a quote from documentation for UISupportedInterfaceOrientations property:
UISupportedInterfaceOrientations (Array - iOS) specifies the interface orientations your application supports. The system uses this information (along with the current device orientation) to choose the initial orientation in which to launch your application. The value for this key is an array of strings.
E.g. this property determines possible orientations your application may be launched in (it's actually most used on iPad). The latter orientation changes are up to your ViewControllers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With