你可以嘗試這樣你要設置添加這個在config.xml,用顏色的十六進制值:
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />
對於ngCordova或離子本地您可以使用
$cordovaStatusbar.styleColor('black');
$cordovaStatusbar.styleHex('#000');
或者你看看狀態欄科爾多瓦插件GitHub的頁面上有一些方法來改變狀態欄的顏色:https://github.com/apache/cordova-plugin-statusbar
對於Android的:
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
對於iOS
在iOS 7,當你設置StatusBar.statusBarOverlaysWebView爲false,你可以通過設置顏色名狀態欄的背景顏色。
StatusBar.backgroundColorByName("red");
支持的顏色名稱是:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
或者
由一個十六進制字符串設置狀態欄的背景色。
StatusBar.backgroundColorByHexString("#C0C0C0");
也支持CSS速記屬性。
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
在WP7和WP8也可以指定值#AARRGGBB,其中AA爲alpha值
最好是發佈@ [Ionic論壇](https://forum.ionicframework.com/)而不是在這裏。 – t0mm13b