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

NavigationBar has a background color when using the Modal component on Android #25

Closed
mydesweb opened this issue Jun 29, 2023 · 6 comments
Assignees

Comments

@mydesweb
Copy link

Why it is needed?

Modal component has a property statusBarTranslucent which works, but there is no option to control the Navigation bar.. there is any way to make also Navigation bar translucent?

Possible implementation

No response

Code sample

No response

@zoontek
Copy link
Owner

zoontek commented Dec 28, 2023

Not as I know, but I highly recommend using react-navigation modals instead.

@baghel-rohan
Copy link

That is exactly the same issue I am also facing.

react-native: 0.71.14,
react-native-bars: 2.4.2, (previously: 1.1.2 still same issue on both versions),
react-native-bootsplash: 4.7.5,

I would, If I could color the navigation bar white but this is how it looks when modal is open

Screenshot 2024-02-02 at 11 18 36 AM

I can manage the status bar, but there should be a prop to handle the background color of the navigation bar, on the go.

Thanks for just reading it all, I would be thankful if it could actually be done.

great library RNbootsplash though 👍

@zoontek
Copy link
Owner

zoontek commented Feb 2, 2024

@baghel-rohan This is actually impossible to do from this library as react-native uses a Dialog for Modal (and so, a different context that the one we can access in react native module).

That's also why these kind of issues occurs and why it have a statusBarTranslucent property (as it doesn't care about the main activity status / navigation bar transparency - see here)

Until there's a solution in React Native for that, I highly recommend using react navigation modals.

@baghel-rohan
Copy link

Hi @zoontek, Thank you for the response, and I really like your work!!

There is another approach to the library which can be implemented, if user wants to, i.e. not using it in edge to edge mode.

I would like to propose a feature which can allow a background color that will be used in navigation bar and status bar if the user is not using library to implement edge to edge.

I have cloned and implemented this on my end, and would like you to see if you would want to intergrate it with the library.

Below is the video after implementing this approach.
untitled.webm

@zoontek
Copy link
Owner

zoontek commented Feb 4, 2024

Unfortunately that's not what I want to achieve with this library.

Android is currently the only platform that bother devs with opaque bars, even if they push against, see the SplashScreen API that is edge-to-edge on system thread or the improved keyboard management that only works when the UI is edge-to-edge, but uh…legacy. We continue to support versions as old as Android 5 when Android 14 is available.

Opaque bars must die, and we need to move collectively to reach this goal 😄

@zoontek
Copy link
Owner

zoontek commented Oct 11, 2024

This quirk is now explained in the README

@zoontek zoontek closed this as completed Oct 11, 2024
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

3 participants