PhoneGap Build上的每个平台配置(config.xml)

时间:2014-01-08 14:25:29

标签: cordova phonegap-build

我有一个PhoneGap 3.1应用程序,我在PhoneGap Build上远程构建 在我的应用程序中,项目的根目录中有一个config.xml文件。该文件包含:

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

但是我想在iOS中将方向限制为纵向模式。 我随机尝试过:

<preference gap:platform="ios" name="orientation" value="portrait" />

<gap:platform name="ios">
    <preference name="orientation" value="portrait" />
</gap:platform>

但这些似乎都不起作用。

如何为特定平台设置首选项?

1 个答案:

答案 0 :(得分:2)

使用PGB,我们现在可以添加到info.plist文件中。所以在你的config.xml中输入:

<gap:config-file platform="ios" parent="UISupportedInterfaceOrientations" overwrite="true">
   <array>
      <string>UIInterfaceOrientationPortrait</string>
   </array>
</gap:config-file>

阅读更多内容并在此处查看此确切示例: http://phonegap.com/blog/2014/01/30/customizing-your-android-manifest-and-ios-property-list-on-phonegap-build/