科尔多瓦状态栏在iOS上为黑色 [英] Cordova statusbar black on black on iOS

查看:72
本文介绍了科尔多瓦状态栏在iOS上为黑色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cordova iPhone应用程序,它使用状态栏插件.状态栏的背景设置为黑色,文本以前为白色.但是自从将插件从0.1.3版本升级到0.1.8以来,文本现在为黑色.

I have a Cordova iPhone app, which uses the statusbar plugin. The status bar's background is set to black, and the text used to be white. But since upgrading the plugin from version 0.1.3 to 0.1.8, the text is now black.

是否可以恢复旧的行为或指定文本颜色?

Is it possible to get the old behavior back, or to specify the text color?

调试信息:

使用Cordova 3.6.3和statusbar插件0.1.8.

Using Cordova 3.6.3 and statusbar plugin 0.1.8.

我在iOS 8和7上看到了这种情况.

I see this behavior on iOS 8 and 7.

iOS项目具有以下配置:

The iOS project has the following configs:

<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />

我正在将Xcode 6.0.1和iOS SDK 8.0一起使用.在Xcode中,未选中隐藏状态栏",并且状态栏样式"设置为默认"(但是当我将其设置为浅"时,会发生相同的情况).

I'm using Xcode 6.0.1, with iOS SDK 8.0. In Xcode, "Hide status bar" is unchecked, and "Status Bar Style" is set to Default (but the same thing happens when I set it to Light).

JavaScript StatusBar.isVisible返回true,如果我调用StatusBar.backgroundColorByHexString("#FFF"),则背景变亮,因此黑色文本变为可见.

The JavaScript StatusBar.isVisible returns true, and if I call StatusBar.backgroundColorByHexString("#FFF"), the background lightens, so the black text becomes visible.

推荐答案

文档中不清楚,但是有StatusBarStyle首选项,即使它不存在,它似乎也会覆盖Xcode中的"Status Bar Style"项目设置.因此,在Cordova的config.xml中进行设置可以解决此问题:

This wasn't clear from the documentation, but there's a StatusBarStyle preference, and even if it's not present, it seems to override "Status Bar Style" from Xcode's project settings. So setting this in Cordova's config.xml fixed the problem:

<preference name="StatusBarStyle" value="lightcontent" />

这篇关于科尔多瓦状态栏在iOS上为黑色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆