简体   繁体   English

iOS Cordova Xcode项目设置与config.xml进行横向定向?

[英]iOS Cordova Xcode Project Settings vs config.xml for Landscape Orientation?

I tried setting the line: 我尝试设置该行:

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

in my config.xml file, but it doesn't work (afterwards I tried doing 'cordova build ios' in the command line but still didn't work. Instead what works is going to my project settings in XCode and selecting the orientation there. 在我的config.xml文件中,但是不起作用(此后,我尝试在命令行中执行“ cordova build ios”,但仍然不起作用。相反,有效的方法是转到XCode中的项目设置并在其中选择方向。

But I'm wondering if this is the correct way? 但是我想知道这是否正确吗? shouldn't everything be done in the config.xml file? 不应该在config.xml文件中完成所有操作吗?

I believe that 我相信

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

is the correct way. 是正确的方法。 Yet it fails :( 却失败了:(

Check PhoneGap Hello World change orientation for a solution I use rather than modify the XCode project. 检查PhoneGap Hello World更改方向以获取我使用的解决方案,而不是修改XCode项目。

Have you tried: 你有没有尝试过:

$ cordova prepare

Or: 要么:

$ cordova platform remove ios
$ cordova platform add ios

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM