如何防止 Phonegap 应用程序切换到横向视图 [英] How to prevent a Phonegap application to switch to landscape view
问题描述
这个应该很简单,但事实并非如此.我试图阻止我的应用程序进入横向视图,所以我更改了 config.xml
文件,如下所示: <preference name="orientation" value="portrait"/>代码>.不幸的是,它不起作用.有任何想法吗?
This one should be very simple, however it's not. I'm trying to prevent my application from going into landscape view so I've changed the config.xml
file like this: <preference name="orientation" value="portrait" />
. Unfortunately, it's not working. Any ideas?
推荐答案
好的,我明白了:Phonegap 忽略了 <preference name="orientation" value="portrait"/>
config.xml
文件中的 code> 是因为我的应用程序处于调试模式.一旦我创建了一个发布版本,它就停止了横向运行.
Ok, so I got it: The reason Phonegap ignored the <preference name="orientation" value="portrait" />
in the config.xml
file is because my app was in debug mode. once I created a release version it stopped from going to landscape.
这篇关于如何防止 Phonegap 应用程序切换到横向视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!