我有一个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>
但这些似乎都不起作用。
如何为特定平台设置首选项?
使用PGB,我们现在能够添加到info.plist文件中。所以在你的配置中.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/