question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nb-header causes status bar color to change

See original GitHub issue

Description of the bug I set a status bar color in app.json and include a status-bar element at the top of my app. However, whenever I go to a page that has a nb-header, the color of the status bar changes to the default blue, and then every page sets to this color

To Reproduce In App.vue in src, put a status-bar element above app-navigation. Use app.json to set the status bar color. Create another page and add it to your app drawer and have a nb-header at the top of that page. Now navigate to that page and your status bar color will change.

What I expected I expect to be able to set a status bar color in app.json and that color be consistent throughout the application.

Screenshots If applicable, add screenshots to help explain your problem. Code: app.json: image

App.vue in src: image

RecipesScreen with nb-header element: image

App: -Open app image -Open drawer image -Navigate to Recipes which has nb-header and status bar color changes image -Showing that going back to home, the color is changed still image

Did I use vue-native-cli to create the project? Yes

Am I using Expo? Yes

Development platform (please complete the following information):

  • Shell/terminal: [e.g. ZSH, PowerShell]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
JohnViciouscommented, Jun 26, 2020

Hope this could help, I am still looking for some way to make it consistently instead of every screen.

Update: I have a solution here

1. Use app.json or place an status-bar above app-navigation as your code

2. Wrap the nb-header to a new element with the 2 mentioned property and use the new element as header

That is actually not a bad idea, that way any time I want to use the header element, I can use that new element as my header. Just want you to know I just got back to my code and your suggestion of marking the color on the element itself did the trick. Thank you very much.

1reaction
doubleh311commented, Jun 26, 2020

Are you saying instead of having the status bar at the top of the app-navigation, have it on each screen instead?

Yes because the nb-header have set the status-bar and here what I have updated my nb-header

<nb-header noShadow :style="style.nbHeader" :androidStatusBarColor="'#ffffff'" :iosBarStyle="'dark-content'"> ... </nb-header>

I use this for screen I have nb-header, with screen I don’t use header, give it status-bar with the same style.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change status bar color with react-navigation - Stack Overflow
It seems that something I am using set the status bar color to blue. However, I tried to remove all dependencies and only...
Read more >
Change Status Bar Color for Android and iOS in .NET MAUI
Are you having trouble changing the background color of the status bar in your .NET MAUI app? Watch this video! With the .NET...
Read more >
Expo: Android status bar color results in taller ... - GitHub
Setting the status bar to an opaque color (as backgroundColor does) leads to this height discrepancy. However, trying to change it in Expo ......
Read more >
barTintColor not working in iOS 15 | Apple Developer Forums
After implementing the above solution, the status bar on the view controller turns black. Is there anything to change it to white colour?...
Read more >
Different ways to change the status bar and navigation bar ...
Different ways to change the status bar and navigation bar color (iOS and Android) in Flutter · 1. Using AppBar (Both iOS and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found