Changing the actionbar background color also applying for the statusbar in ios


#1

Hi All,

While I am trying to change the background color of actionbar the statusbar color also changing and that is looking really awkward. I want only actionbar color to be changed and don’t want statusbar as it is.
Any suggestions .!!!

Thanks


#2

hi, have you tried this plugin to manage your statusbar: https://market.nativescript.org/plugins/nativescript-statusbar

I haven’t used it for a while, let me know if it works for what you need


#3

didn’t get what is barColor and barStyle .! there is no definition or purpose mentioned in the article.


#4

you can also change your status bar background color without needing action bar or a color that is different from action bar color . here is an example

const frameModule = require("ui/frame");
const app = require("tns-core-modules/application");
var Color =  require("tns-core-modules/color").Color;

function pageLoaded(args) {
page = args.object;
if (app.ios) {
        page.backgroundSpanUnderStatusBar = false;
        let iosFrame = frameModule.topmost().ios;
        iosFrame.controller.view.window.backgroundColor = new Color("blue").ios;
    };
}