Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS 6 rotations: supportedInterfaceOrientations doesn´t work?
    text
    copied!<p>I´m having this issue with iOS 6 SDK: I´m having some views that should be allowed to rotate (e.g. a videoview), and some that don´t. Now I understand I have to check all orientations in the app´s Info.plist and then sort out in each ViewController, what should happen. But it doesn´t work! The app always rotates to the orientations, that are given in the Info.plist.</p> <p>Info.plist:</p> <pre><code>&lt;key&gt;UISupportedInterfaceOrientations&lt;/key&gt; &lt;array&gt; &lt;string&gt;UIInterfaceOrientationPortrait&lt;/string&gt; &lt;string&gt;UIInterfaceOrientationLandscapeLeft&lt;/string&gt; &lt;string&gt;UIInterfaceOrientationLandscapeRight&lt;/string&gt; &lt;/array&gt; </code></pre> <p>any ViewController that shouldn´t be allowed to rotate:</p> <pre><code>//deprecated - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskPortrait; } </code></pre> <p>Observation: App rotates to landscape and portrait orientation. Any ideas why or what I´m doing wrong?</p> <p>Cheers, Marc</p> <p>Edit: My latest findings also indicate, that if you want to have rotation at some point in your app, you <em>have</em> to activate all four rotation directions in your project settings or Info.plist. An alternative to this is to override </p> <pre><code>- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window </code></pre> <p>in your AppDelegate, which overrides the Info.plist. It isn´t possible anymore to set only Portrait in your Info.plist and then having rotation in some ViewController by overriding shouldAutorotateToInterfaceOrientation or supportedInterfaceOrientations. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload