Can't set color of statusbar with cordova-plugin-statusbar

前端 未结 3 1758
有刺的猬
有刺的猬 2021-01-01 02:10

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 fo

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-01 02:52

    Gil's solution doesn't work for me (I've a Samsung Galaxy S7 Edge).

    onDeviceReady: function () {
        app.receivedEvent('deviceready');
        console.log(StatusBar);
        if (window.cordova && StatusBar) {
            StatusBar.backgroundColorByHexString('#BE1912');
        }
    },
    

提交回复
热议问题