Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the point of "Supported Device Orientation" in iOS application setting?

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?

like image 514
Morgan Cheng Avatar asked Dec 27 '11 12:12

Morgan Cheng


People also ask

What is portrait orientation on iPhone?

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.

How do I turn off landscape mode in IOS?

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.


1 Answers

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.

like image 173
iHunter Avatar answered Oct 06 '22 23:10

iHunter