GeraldoBastos
GeraldoBastos

Reputation: 313

Navigation Controller in landscape with Storyboard [iPhone]

I'm working with Navigation Controller in my storyboard, but my application is always in portrait format when I put the simulator in landscape. Why? =(

Upvotes: 1

Views: 516

Answers (1)

Bot
Bot

Reputation: 11855

Change

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

To

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

Also make sure in your project settings you have 'Supported Device Orientations' set to allow Landscape.

Upvotes: 1

Related Questions