在Android科尔多瓦全屏黑网吧(Cordova Fullscreen black bars on

2019-09-29 02:26发布

我在屏幕的顶部和底部获得在我的Android应用程序科尔多瓦黑色横条。 我试着加入全屏插件和标签config.xml文件,但它不会消失:

https://i.imgur.com/l2ZIaAJ.png

config.xml文件:

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Test</name>
    <description>
        Test
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />

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

    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <engine name="browser" spec="^5.0.0" />
    <engine name="android" spec="^6.3.0" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
    <plugin name="cordova-plugin-file" spec="^4.3.3" />
    <plugin name="cordova-plugin-filechooser" spec="git+https://github.com/ihadeed/cordova-filechooser.git" />
    <plugin name="cordova-plugin-fullscreen" spec="^1.2.0" />
    <plugin name="cordova-plugin-console" spec="^1.1.0" />
</widget>

JS:

    alert("fullscreen test");
    AndroidFullScreen.setSystemUiVisibility(AndroidFullScreen.SYSTEM_UI_FLAG_FULLSCREEN | AndroidFullScreen.SYSTEM_UI_FLAG_LOW_PROFILE, function(){
        alert("success fullscreen");
    }, function(){
        alert("error fullscreen");
    });

“成功全屏”被惊动了,所以我不知道什么是错的。

我也尝试添加到这个清单:

AndroidManifest.xml中:

android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

没运气。 总不能让这些黑条消失。

文章来源: Cordova Fullscreen black bars on Android