android – Cordova忽略屏幕方向锁

栏目: IOS · Android · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/21212246/cordova-ignores-screen-orientation-lock

参见英文答案 > fix the orientation on page to landscape only in Jquery-mobile 3个

我正在使用Cordova 3.3.0和我的Galaxy S3(运行最新的Cyanogenmod)来测试我正在处理的应用程序;我需要应用程序屏幕保持“纵向”模式并即使用户旋转设备也会被锁定.无论我尝试过什么或我遵循的教程,应用程序都忽略了锁定屏幕的首选项.我究竟做错了什么?

这是我的config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.numediaweb.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Test</name>
    <description>
        Test.</description>
    <author href="http://test.com" email="abdel@test.com">
        me
    </author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="orientation" value="portrait" />
    <preference name="fullscreen" value="true" />
    <preference name="SplashScreen" value="splash" />
    <preference name="SplashScreenDelay" value="3000" />
</widget>

修正了Cordova 3.4.1.

现在偏好方向有效!

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

翻译自:https://stackoverflow.com/questions/21212246/cordova-ignores-screen-orientation-lock


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Linux命令行与shell脚本编程大全 第3版

Linux命令行与shell脚本编程大全 第3版

[美]布鲁姆,布雷斯纳汉 / 门佳、武海峰 / 人民邮电出版社 / 2016-8-1 / CNY 109.00

这是一本关于Linux命令行与shell脚本编程的全方位教程,主要包括四大部分:Linux命令行,shell脚本编程基础,高级shell脚本编程,如何创建实用的shell脚本。本书针对Linux系统的最新特性进行了全面更新,不仅涵盖了详尽的动手教程和现实世界中的实用信息,还提供了与所学内容相关的参考信息和背景资料。通过本书的学习,你将轻松写出自己的shell脚本。一起来看看 《Linux命令行与shell脚本编程大全 第3版》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

html转js在线工具
html转js在线工具

html转js在线工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试