3

I've been trying to figure this out for a while now and its possibly a duplicate but I haven't found a correct solution. So I've created a view controller and the build the xib in landscape mode. When I try to push the view controller, it displays as Portrait but I want it to show up landscape. I've added the following methods to my code:

- (BOOL)shouldAutorotate {
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeRight;
}

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

Any help is appreciated!

Mikerizzo
  • 587
  • 1
  • 4
  • 22
  • 1
    have you checked http://stackoverflow.com/questions/12640870/ios-6-force-device-orientation-to-landscape?rq=1 ? – cornelb Jan 27 '14 at 20:25
  • 1
    yup. no help though. I really just want to load the xib file as landscape even if the user is holding the phone normally. – Mikerizzo Jan 27 '14 at 20:27
  • 2
    please check this link : http://stackoverflow.com/questions/18409310/force-landscape-for-one-view-controller-ios – Jay Mehta Jan 28 '14 at 12:43

0 Answers0