What does ā€œSupported Device Orientationā€ mean in iOS app settings?

In the XCode4.2 + iOS5 SDK, I set the ā€œOrientation of the supported deviceā€ to ā€œPortraitā€ only. I expect that all views in the application will only support the portrait orientation. However, while I rotate the iPhone simulator, I found that other orientations still work.

It seems that the shouldAutorotateToInterfaceOrientation method in the ViewController is the key to deciding whether this orientation is supported. So, why set the ā€œSupported device setupā€ parameter at the application level if it does not limit the orientation?

+6
source share
2 answers

Here is a quote from the document for the UISupportedInterfaceOrientations property :

UISupportedInterfaceOrientations (Array - iOS) determines the interface orientation supported by your application. The system uses this information (along with the current orientation of the device) to select the initial orientation for launching the application. The value for this key is an array of strings.

eg. this property determines the possible orientations in which your application can be launched (it is actually most used on the iPad). Recent orientation changes depend on your ViewControllers.

+10
source

Oon iOS6.0, it looks like this property really does what you want to limit the orientation of the entire application. Doesn't work on iOS5.0 ...

0
source

Source: https://habr.com/ru/post/904531/


All Articles