views:

46

answers:

3

Is there a way where I can only allow my app viewable in landscape mode? I've managed to default the application's orientation to landscape, however in the iPad simulator, when I do Command->Arrow, the application rotates to portrait. I've removed the listings in the plist under "Supported interface orientations" for both of the Portrait entries, however that doesn't seem to've changed anything.

Any idea?

+1  A: 

Do a project find for "autorotate", and edit the methods you'll find accordingly.

Eiko
+1  A: 

In your view controller, there's a delegate method for this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || 
            (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Joost Schuur
Perfect. I knew I've seen this line of code before, just forgot about it.
Don Wilson