制作一个Android应用程序全屏科尔多瓦全屏、科尔、应用程序、多瓦

由网友(我已没心、谈何花心)分享简介:我是初来乍到科尔多瓦,并想使该全屏显示(隐藏任务栏上的Andr​​oid底部)的应用程序。 I'm a newcomer to Cordova, and am trying to make an app that appears full screen (hiding the taskbar at the botto...

我是初来乍到科尔多瓦,并想使该全屏显示(隐藏任务栏上的Andr​​oid底部)的应用程序。

I'm a newcomer to Cordova, and am trying to make an app that appears full screen (hiding the taskbar at the bottom of Android).

我在网上看了看,似乎有两种不同的方法....我曾尝试添加

I have looked online and there seem to be two different techniques.... I have tried adding

我的config.xml

to my config.xml

,以便它读取

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <preference name="AndroidLaunchMode" value="singleTop" />
    <feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
    </feature>
    <name>HelloCordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="Fullscreen" value="true" />
    <preference name="WebViewBounce" value="true" />
    <preference name="Orientation" value="landscape" />
    <preference name="HideKeyboardFormAccessoryBar" value="true" />
</widget>

状态栏仍然在底部(尽管应用程序不会在景观修复)。我也曾尝试包括添加线hellocordova.java其他建议。这种进口android.view.WindowManager;然后加载index.html的后面添加行:

The status bar still remains at the bottom (although the app does fix at landscape). I have also tried the other advice which involves adding lines to hellocordova.java. This imports android.view.WindowManager; and then adds lines after loading index.html:

(WindowManager.LayoutParams.FLAG_FULLSCREEN,                   WindowManager.LayoutParams.FLAG_FULLSCREEN WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

该方法从与科尔多瓦构建Android编译停止的应用程序。

This method stops the app from compiling with cordova build android.

我在哪里可以寻找的任何提示。

Any tips of where I can be looking.

我使用的是Android 4.1.1

I'm using Android 4.1.1

推荐答案

不幸的是,插件并没有为我工作,所以我这些步骤管理它:

Unfortunately the Plugin didn't work for me, so I managed it with these steps:

添加了全屏preference在的config.xml 文件:

Add the Fullscreen preference in your config.xml file:

<preference name="Fullscreen" value="true" />

找到的Andr​​oidManifest.xml 平台/安卓/ 并添加全屏主题

<manifest ...>
    <application ...>
        <activity ... android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

最后,这是很难的步骤,使用href="https://developer.android.com/training/system-ui/immersive.html" rel="nofollow">沉浸式全屏模式的

阅读全文

相关推荐

最新文章