我有一个在 PhoneGap Build 上远程构建的 PhoneGap 3.1 应用程序。
在我的应用程序中有一个config.xml
文件位于项目的根目录下。该文件包含:
<preference name="orientation" value="default" />
但是我想将 iOS 中的方向限制为纵向模式。
我随机尝试过:
<preference gap:platform="ios" name="orientation" value="portrait" />
and
<gap:platform name="ios">
<preference name="orientation" value="portrait" />
</gap:platform>
但这些似乎都不起作用。
如何设置特定平台的首选项?
借助 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/ http://phonegap.com/blog/2014/01/30/customizing-your-android-manifest-and-ios-property-list-on-phonegap-build/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)