Nativescript: Cannot change the iOS status bar text color since 2.0

Created on 2 May 2016  路  6Comments  路  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching Stack Overflow?

Yep :) http://stackoverflow.com/questions/36989709/nativescript-cannot-change-ios-status-bar-color

Tell us about the problem

As of the 2.0 release, I am no longer able to change the iOS status bar鈥檚 text color.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.0.0
  • Cross-platform modules: 2.0.0
  • Runtime(s): 2.0.0

    Please tell us how to recreate the issue in as much detail as possible.

Use the following main-page.xml:

<Page loaded="loaded">
    <Page.actionBar>
        <ActionBar title="Whatever"></ActionBar>
    </Page.actionBar>
</Page>

And the following main-page.js:

var frameModule = require("ui/frame");
exports.loaded = function(args) {
    var page = args.object;
    if (page.ios) {
        var navigationBar = frameModule.topmost().ios.controller.navigationBar;
        navigationBar.barStyle = UIBarStyle.UIBarStyleBlack;
    }
};

This code changed the iOS status bar to use white text with version 1.7.1 of the modules, but now it has no effect.

Thanks.

bug done ios

All 6 comments

I see the same issue after upgrading to 2.0.0. StatusBar text used to be all white, now it is always black. Using the same code as above.

Hi @tjvantoll ,
Thank you for reporting this issue
I was able to recreate the problem in a local project.
Unfortunately I confirm that this is a real issue.
The problem will be scheduled for fixing
Temporary solution can be to set navigationBar.barStyle to be equal to 1 and status bar text color will be change.
I am attaching link to my sample project repository:
https://github.com/tsonevn/StatusBarTextColor_Issue2062.git

Regards,
@tsonevn

@tsonevn Thanks for the reply, but unfortunately your workaround is not working for me either. When I clone https://github.com/tsonevn/StatusBarTextColor_Issue2062 and run it I still see black text in the status bar.

screen shot 2016-05-03 at 8 49 23 am

Hi @tjvantoll,

I am sorry for my mistake. Actually I tested my project with the old CLI 1.7.1 and at the moment do not have temporary solution. I have updated my repo https://github.com/tsonevn/StatusBarTextColor_Issue2062.git

This issue will be scheduled for fixing soon.
Regards,
@tsonevn

This is still not fixed, any update on this?

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings