0
votes

my iPhone App includes 2 view-orientations: portrait and landscape. It starts in portrait, but includes 2 view controllers, which should rotate automatically to landscape.

Thats my code in the landscape-views:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}

But when the view loads in the iPhone-simulator, the virtual device stays in portrait, and the content of the landscape-view isn't displayed correctly. I have to turn the device manually(simulator).

Can you give me a solution for my problem? Or is it only a problem with the simulator?

1

1 Answers

0
votes

You can specify in your info.plist the initial interface orientation - this ought to get your app launching in the correct orientation. Look for a line called Initial interface orientation.

Or, if you can't find that line, add this line to your info.plist:

UIInterfaceOrientation with the value: (String) UIInterfaceOrientationLandscapeRight

Hope that helps.