Cordova StatusBar默认样式文本颜色白色

时间:2014-05-19 22:30:11

标签: ios cordova

我正在使用Christophe Coenraets的sample Angular app作为模板为Cordova构建一个简单的角度应用程序。

我添加了Cordova Status Bar plugin并将其构建到我的应用中。

根据文档,如果我在StatusBar.styleDefault()方法中调用onDeviceReady,我应该在半透明背景上显示深色文字。

我的背景是半透明的,但我的文字仍然是白色的。

在我的onDeviceReady方法中,我有:

onDeviceReady: function() {
    app.receivedEvent('deviceready');
    StatusBar.overlaysWebView(false);
    StatusBar.styleDefault();
},

正如您在下图中所看到的,对黑色文字没有爱。关于如何获取黑色文字的任何想法?

White Text

1 个答案:

答案 0 :(得分:1)

我在app.js中调用它,它似乎按照你喜欢的方式工作。

.run(function($ionicPlatform) {
   $ionicPlatform.ready(function() {

    // Hide the accessory bar by default (remove this to show the accessory bar above the    keyboard
    // for form inputs)

    if(window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
        // org.apache.cordova.statusbar required
         StatusBar.styleDefault();
    }
  });
})