2012-10-31 40 views
0

检查了很多关于此问题的问题,但没有任何工作为我的情况。所以我需要再问一次。如何在phonegap应用程序中只支持ios 6.0的横向版本?

我建立的应用程序与手机隙framework.Upto的iOS 5,它的运行良好,但与IOS 6.0的情况下,这些方法不支持,所以我跟他们代替:在我MainViewController.m

- (BOOL)shouldAutorotate 
{ 
return YES; 
} 

- (NSUInteger)supportedInterfaceOrientations 
{ 
return UIInterfaceOrientationMaskLandscape; 
} 

文件。

我需要我的整个应用程序只在风景左侧和风景右侧。

在我的plist文件中,我提到了iphone和ipad的左右风景。

任何想法都会有很大的帮助。

感谢

回答

2

得到发生solution.This问题,因为MainViewController没有被设置为在AppDelegate.m的RootViewController的。 在你AppDelegate.m取代:

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

self.window.rootViewController = self.viewController; 

然后正常的行为在iOS 6.0

0

对于IOS

在config.xml中设定的运行我的应用程序:

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

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

在 “项目名”,在IOS -info.plist文件夹的资源文件夹下的 “UISupportedInterfaceOrientations” 载:

UIInterfaceOrientationLandscapeLeft 

UIInterfaceOrientationLandscapeRight 

用于纵向的

UIInterfaceOrientationPortrait 

UIInterfaceOrientationPortraitUpsideDown 

其中包括适用于您的需求。

相关问题