react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[v2]StatusBar color

Open heroic opened this issue 8 years ago • 22 comments

Issue Description

I am setting my navbar's background, which works without a problem, however the background color change doesn't affect the statusbar background. Here's my default settings:

Navigation.setDefaultOptions({
  topBar: {
    background: {
      color: '#0079f3'
    }
  },
  statusBarStyle: 'light'
})

Here's what this generates: https://imgur.com/a/OHwLbD7


Environment

  • React Native Navigation version: 2.0.2274
  • React Native version: 0.55.3
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Device, Debug

heroic avatar May 03 '18 06:05 heroic

ios statusBar color Can not be changed . react native provided Components Black and white style . Other customizations can

qiepeipei avatar May 03 '18 07:05 qiepeipei

@qiepeipei Not sure why it can't be changed, every app out there has the status bar color the same as the navbar color on ios, and a different color on android.

I am guessing you mean the text color, I know that can only be white or black. I am looking to change the background color

heroic avatar May 03 '18 07:05 heroic

@heroic ios statusBar No background color . view style default Screen top . You can customize tabbar settings Background color

qiepeipei avatar May 03 '18 07:05 qiepeipei

I'm getting the same problem. I'm trying to switch from React Navigation and It was setting my statusBar on iOS the same color as my topBar was.

Now I'm setting the color to the topBar but it does not reflect on the statusBar.

ahmad2smile avatar May 03 '18 10:05 ahmad2smile

What it should be:

Here's what it is:

screen shot 2018-05-03 at 3 57 11 pm

ahmad2smile avatar May 03 '18 10:05 ahmad2smile

Same as #3136. And, as @ahmad2smile said, it is possible because react-navigation and react-native-navigation v1 allow you to control it and change colors.

gabrielvcbessa avatar May 03 '18 13:05 gabrielvcbessa

@guyca Is this a missing feature or are we doing something wrong?

gabrielvcbessa avatar May 07 '18 05:05 gabrielvcbessa

@gabrielvcbessa Will need to look into it, could be a missing feature. We're a bit busy migrating the Wix app to v2, so it might be a week (more or less) until we get to this.

guyca avatar May 07 '18 07:05 guyca

Just a thought. It would be really important for ppl like me, when I'v it by default in my previous navigation lib I can't convince my team if its not in this one.

ahmad2smile avatar May 07 '18 07:05 ahmad2smile

@ahmad2smile We're working on this project full time and tracking progress in the board. This issue has been prioritised, nothing more I can do. You're welcome to look into this and submit a PR

guyca avatar May 07 '18 10:05 guyca

It is fixed on v2.0.2275, but just on iOS. On android it still not working.

gabrielvcbessa avatar May 08 '18 19:05 gabrielvcbessa

Works like a charm.

ahmad2smile avatar May 10 '18 09:05 ahmad2smile

1 thing I had to update. Event onAppLaunched isn't available on latest alpha Its switched with registerAppLaunchedListener I think. The Documentation doesn't reflect this I checked the source and It worked.

afaik, Docs are auto generated, If not I can submit a pr for this. @guyca ;)

ahmad2smile avatar May 10 '18 10:05 ahmad2smile

Hey @ahmad2smile Only a small section of the docs is auto generated. You're more then welcome to PR the docs 👍

guyca avatar May 10 '18 14:05 guyca

statusBarBackgroundColor is implemented for Android in 2.0.2286 Will address statusBarStyle soon

guyca avatar May 15 '18 06:05 guyca

Hi. Is this resolved? I still can't change statusBar color on Android. I'm running on version 0.56.0

reddeguzman avatar Oct 29 '18 11:10 reddeguzman

So how do we change the text color on Android there's no documentation?

ollyde avatar Nov 27 '18 11:11 ollyde

style: 'dark' | 'light'

Same as in iOS

guyca avatar Nov 27 '18 11:11 guyca

Ah so there's no way to set the hex value on Android for custom system menu colors I see.

ollyde avatar Nov 27 '18 11:11 ollyde

is it possible now to do the opposite? Because once I do this:

Navigation.setDefaultOptions({
  topBar: {
    background: {
      color: '#0079f3'
    }
  },
  statusBarStyle: 'light'
})

I want to just change the color of the status bar.

AugustoAleGon avatar Mar 18 '19 22:03 AugustoAleGon