PhoneGap Build - 构建一个Android应用程序?

PhoneGap Build - 构建一个Android应用程序?

问题描述:

我遇到的问题是我想要在我的平板电脑上运行的应用程序无法定位,我只想要横向视图。PhoneGap Build - 构建一个Android应用程序?

我已经使用cordova创建了应用程序,然后添加了平台“Android”。然后,我将config.xml移动到带有HTML,CSS和JavaScript代码的www文件夹中,并在config.xml中添加了以下代码行。

然后我用config.xml压缩www文件夹,并使用PhoneGap Build来转换为Android应用程序。

当我在平板电脑上进行测试时,方向不起作用。如何使用config.xml阻止平板电脑上的方向?

I found the preference here.

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

的Config.xml:

<?xml version='1.0' encoding='utf-8'?> 
<widget id="com.BachelorProject.KPEC" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
    <name>ProjectKPEC</name> 
    <description> 
     A sample Apache Cordova application that responds to the deviceready event. 
    </description> 
    <author email="[email protected]" href="http://cordova.io"> 
     Apache Cordova Team 
    </author> 
    <content src="index.html" /> 
    <access origin="*" /> 

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

</widget> 
+0

我有什么不喜欢的原因吗? –

+0

您正在使用哪种手机版本? – kumar

偏好属性值是大小写敏感的,我认为。 尝试:

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

而不是

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

谢谢,我试过这个,但它不起作用。 –

我发现了这个问题,刚刚建成,整个项目加入,并再次android平台,然后让我感动的WWW文件夹内的config.xml中,和它的工作。