Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal/Popover backdrop causes navbar to change color #30

Open
feruzm opened this issue Jan 29, 2020 · 3 comments
Open

Modal/Popover backdrop causes navbar to change color #30

feruzm opened this issue Jan 29, 2020 · 3 comments

Comments

@feruzm
Copy link

feruzm commented Jan 29, 2020

Is there way to force color change to stay unless you change it manually again?

Right now, it has been inconsistent, if modal or popover, dropdown modals are opened, they usually have background overlay, cannot figure out how to make color stay and don't get affected by modals.

Any ideas or suggestions?

@sergchernata
Copy link

Dealing with the same issue.

@crutchcorn
Copy link

This is a well-known issue. Follow the guide for this article and it should help resolve things for you:

https://github.com/mockingbot/react-native-immersive#restore-immersive-state

@ucheNkadiCode
Copy link

ucheNkadiCode commented Jan 8, 2023

I had this problem in android. What I believe is happening is the react-native modal is simply taking the default android:navigationBarColor and every time it pops up, it overwrites the current navigation bar color until it gets dismissed.

The flag statusBarTranslucent was not working for me.

I was able to fix this by navigating to res/values/styles.xml

Then in the AppTheme style I added navigationBarColor to be transparent.
It looks like this

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:textColor">@android:color/black</item>
    <item name="android:navigationBarColor">@android:color/transparent</item> // <----This is what I added
  </style>

Then in my react native code, I am able to call

import changeNavigationBarColor from "react-native-navigation-bar-color";

  const setDarkMode = (isDarkMode: boolean) => {
    // logic to change my apps theme to dark mode
    changeNavigationBarColor(isDarkMode ? "black" : "white"); // Then I change the navigation bar color.
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants