科尔多瓦忽略屏幕方向锁 [英] Cordova ignores screen orientation lock
问题描述
我使用的是科尔多瓦3.3.0与我的Galaxy S3(运行最新Cyanogemode)来测试一个应用程序,我的工作;我需要的应用程序的屏幕停留在肖像模式,即使用户旋转设备。无论是我的尝试或教程我跟着,应用程序被忽略了preferences锁定屏幕被锁定。我究竟做错了什么?
下面是我的config.xml
< XML版本=1.0编码=UTF-8&GT?;
<微件ID =com.numediaweb.test版本=0.0.1的xmlns =http://www.w3.org/ns/widgets的xmlns:CDV =http://cordova.apache.org /ns/1.0">
<名称>测试与LT; /名称>
<描述>
。测试< /描述>
<作者HREF =http://test.com电子邮件=abdel@test.com>
我
< /笔者>
<内容SRC =的index.html/>
<获得原产地=*/>
< preference名=方向值=画像/>
< preference名=全屏值=真/>
< preference名=闪屏的价值=扑通/>
< preference名=SplashScreenDelay值=3000/>
< /部件>
我刚刚发现了一个有趣的回答后,我张贴的问题(在相关的小窗口右侧);它在科尔多瓦并修复它一个错误,您可以编辑AndroidManifest.xml中喜欢的东西;
<活动机器人:screenOrientation =画像机器人:configChanges = ...
或者使用插件。
FI preFER编辑清单,因为它很容易。
I'm using cordova 3.3.0 with my Galaxy S3 (running latest Cyanogemode) to test an app I'm working on; I need the app screen to remain in "portrait" mode and be locked even if the user rotates the device.. No matter what I tried or tutorials I followed, the app is ignoring the preferences to lock the screen. What am I doing wrong?
Here's my 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>
I just found an interesting answer after I posted the question (in the related widget right); It's a bug in Cordova and to fix it, you either edit the AndroidManifest.xml to something like;
<activity android:screenOrientation="portrait" android:configChanges=...
Or use a plugin.
FI prefer to edit the manifest as it is easy.
这篇关于科尔多瓦忽略屏幕方向锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!