0

Ok, so I want to have 3 view and all of them landscape but i want 2 of the to be in ONLY landscape and i want ONLY 1 OF THEM to be in portrait. When i do this they all go in portrait. I am using storyboards.

I have in the .m file:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeLeft)
        return YES;

    return NO;
}

I have it set up to landscape left in the target and in the plist, I have "Initial interface orientation" and "supported orientations landscape left". I have tried everything and nothing has worked, someone please help me.

Piyush Dubey
  • 2,416
  • 1
  • 24
  • 39

1 Answers1

0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight);

}

Add this to each view controller which you want to have in landscape mode. Hope this will help you.

Priya
  • 637
  • 4
  • 5
  • I am using storyboard how should i do that? – Kyle Greenlaw Sep 23 '12 at 13:05
  • How the scene is actually displayed is not determined by the storyboard but rather the viewcontroller. You need to create an UIViewController subclass and implement - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation as above which return YES only if the interface orientation is a landscape orientation. – Priya Sep 24 '12 at 11:41