ios - Unable to change $cordovaStatusbar text color -
i'm having issues status bar of ionic app. more i'm not able change bar default color, no matter style apply.
i checked ngcordova , cordovastatusbar plugin installed correctly.
code snippet
app.run(function ($ionicplatform, $cordovastatusbar) { $ionicplatform.ready(function () { // color ios status bar if (window.statusbar) { $cordovastatusbar.overlayswebview(true); $cordovastatusbar.stylehex('#f50'); } }); }); this result in xcode simulator ionic emulate ios command.
edit:
after many tests think problem more in depth. neither .show() or .hide() methods working.
app.run(function ($ionicplatform, $cordovastatusbar) { $ionicplatform.ready(function () { $cordovastatusbar.hide(); //not hiding status bar }); });
from plugin github page
on ios 7, when set statusbar.statusbaroverlayswebview false, can set background color of statusbar hex string (#rrggbb).
so got working doing following:
- making sure ngcordova installed
set overlayswebview false , set color.
if(window.statusbar) { $cordovastatusbar.overlayswebview(false); $cordovastatusbar.stylehex('#ff0000') //red }


Comments
Post a Comment