PhoneGap 3.0.0locking方向

我正在做一个PhoneGap的游戏。 我的游戏需要将屏幕“locking”到横向模式。 我需要将其locking,以便您不能将设备转换到其他风景模式,旋转屏幕(这样,无论设备旋转到哪个方向,屏幕都不会改变方向,它将保持不变它之前)。 我已经试过看这个问题 ,但是这对我没有用。 我需要一个可以轻松使用的解决scheme,最好是使用Android和iOS。 我正在使用PhoneGap的工具,所以在terminal中,我运行:

phonegap run android 

build立和安装我的应用程序到我的平板电脑上。

在IOS中locking方向:只需在Xcode中打开项目,然后单击项目并在摘要中select方向 在这里输入图像说明

为Android添加android:screenOrientation="landscape"到每个活动,例如:

 <activity android:name=".SomeActivity" android:label="@string/app_name" android:screenOrientation="landscape"> 

我不得不做以下(cordova3.3):在* -info.plist – 我有:

  <key>UISupportedInterfaceOrientations</key> <array/> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> 

我把它改成:

 <key>UISupportedInterfaceOrientations</key> <array/> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> </array>