0

Checked with so many asked questions about this but nothing has worked for my case.So i needed to ask it again.

I am building app with phone-gap framework.Upto ios 5 it's running fine but as the case with ios 6.0 those methods are not supported so i replaced them with:

- (BOOL)shouldAutorotate
{
return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}

in my MainViewController.m file.

I need my entire app in only landscape left and landscape right.

In my plist file i have mentioned landscape left and right for both iphone and ipad.

Any idea would be of great help.

thanks

Mayukh Raaj
  • 403
  • 2
  • 7
  • 19

2 Answers2

2

Got the solution.This problem occurs because the MainViewController is not set to be the rootViewController in AppDelegate.m. In your AppDelegate.m replace:

[self.window addSubview:self.viewController.view];

with

self.window.rootViewController = self.viewController;

Then it behaves properly for my app running on ios 6.0

Mayukh Raaj
  • 403
  • 2
  • 7
  • 19
0

For IOS

In config.xml set:

<preference name="orientation" value="landscape"></preference>

or

<preference name="orientation" value="portrait"></preference>

In "ProjectName"-info.plist file in ios folder under resources folder for "UISupportedInterfaceOrientations" set:

UIInterfaceOrientationLandscapeLeft

or

UIInterfaceOrientationLandscapeRight

or

for portrait orientation:

UIInterfaceOrientationPortrait

or

UIInterfaceOrientationPortraitUpsideDown

Include which is applicable for your requirements.