Note that there are some explanatory texts on larger screens.

plurals
  1. POUIView stuck in potrait mode
    primarykey
    data
    text
    <p>I am having trouble starting the app in landscape mode. The view is always shown in potrait mode. </p> <p>I have the following configured in the plist:</p> <pre><code>&lt;key&gt;UISupportedInterfaceOrientations&lt;/key&gt; &lt;array&gt; &lt;string&gt;UIInterfaceOrientationLandscapeLeft&lt;/string&gt; &lt;string&gt;UIInterfaceOrientationLandscapeRight&lt;/string&gt; &lt;/array&gt; </code></pre> <p>The UIViewController is created in AppDelegate.m:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.myViewController = [MyViewController alloc]; UIView *myView = [[UIView alloc] init]; myView = [UIColor whiteColor]; self.myViewController.view = myView; self.window.rootViewController = self.myViewController; self.window makeKeyAndVisible]; return YES; } </code></pre> <p>Added shouldAutorotateToInterfaceOrientation to MyViewController.m</p> <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } </code></pre> <p>When the device is in portrait mode and the app starts, the status bar is in landscape mode. However when the UIView gets shown, it will end up in portrait mode. The same thing happens when the device is in landscape mode.</p> <p>However, when I create the UIViewController in Interface Builder, it works.</p> <p>Is this related to autoresizemasking because it didn't work when I add this in AppDelegate.m:</p> <pre><code> myView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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