无法设置状态栏的颜色科尔多瓦 - 插件,状态栏 [英] Can't set color of statusbar with cordova-plugin-statusbar
问题描述
我想改变原生状态栏的颜色离子的应用程序,但我不能得到它的工作。我已经安装了科尔多瓦,插件,状态栏,它安装的罚款。下面code完美的作品:
I'm trying to change the color of the native status bar in an ionic app, but I can't get it to work. I've installed cordova-plugin-statusbar, and it installs fine. The following code works perfectly:
if (StatusBar) {
StatusBar.hide();
}
但是,试图使用任何其他可用的功能,例如:
But trying to use any other of the available functions, for example:
if (StatusBar) {
StatusBar.backgroundColorByHex('#RRGGBB');
}
不工作,刚刚应用程序使用标准的状态栏。
doesn't work, the just app uses the standard statusbar.
我还添加了< preference NAME =StatusBarOverlaysWebViewVALUE =真/>
来config.xml文件,以及它的设置编程在运行时。
I've also added <preference name="StatusBarOverlaysWebView" value="true" />
to config.xml, as well as setting it programmatically at runtime.
科尔多瓦是5.1.1版本,离子是1.5.5版本,我使用的是Android的21进行测试。任何人都经历了同样的问题或不知道如何解决它?
Cordova is version 5.1.1, Ionic is version 1.5.5 and I'm using Android 21 for testing. Has anyone experienced the same problem or know how to fix it?
推荐答案
你能尝试删除状态栏插件,并重新安装,像这样:
Could you try removing the status bar plugin and reinstalling like so:
ionic plugin rm org.apache.cordova.statusbar
ionic plugin add https://github.com/apache/cordova-plugin-statusbar.git
同样已在离子问题跟踪被报道一>
这篇关于无法设置状态栏的颜色科尔多瓦 - 插件,状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!