Question

I have just run into a problem regarding how my app launches. Even though I have selected launch from portrait my app always launches in landscape view and I have to rotate my iPod to make it switch to portrait.I have been mainly working in the storyboard section of my app and don't have much code at this point. Do I need to enter some code to launch from portrait? Thanks, I am a beginner and am very grateful for any help.

Was it helpful?

Solution

Make sure you follow these 3 steps:

1) On the .plist file make sure landscape is listed as one of the supported orientations.

2) On the viewcontroller for that view make sure that your code returns yes for the should autorotate...

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

3) On the IB select your initial view and then on the fourth tab from the property inspector, under the simulated metrics make sure that Orientation Landscape is selected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top