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

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

Open mydesweb opened this issue 2 years ago • 5 comments

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

mydesweb avatar Jun 29 '23 12:06 mydesweb

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

zoontek avatar Dec 28 '23 22:12 zoontek

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 👍

baghel-rohan avatar Feb 02 '24 05:02 baghel-rohan

@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.

zoontek avatar Feb 02 '24 09:02 zoontek

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

baghel-rohan avatar Feb 04 '24 15:02 baghel-rohan

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 avatar Feb 04 '24 17:02 zoontek

This quirk is now explained in the README

zoontek avatar Oct 11 '24 19:10 zoontek