如何防止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忽略config.xml
文件中的<preference name="orientation" value="portrait" />
的原因是因为我的应用程序处于调试模式.一旦创建了发行版,它便停止了使用.
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屋!