-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Unable to set transparent BG of Tab Navigator Screen #8076
Comments
Hi, any news about this one ? Thanks |
Add The code below will make a transparent Bottom Bar
|
Thanks this works we should close the issue now :) |
Hi, This issue remains, as the OP stated the BG colour can't not be set on the screen ( not the bar ) it is always the default grey. Having a requirement to make the background transparent to overlay over native screens means this is broken. |
Not sure if this is the same issue holding this ticket open, but I was able to address this with |
@chasepoirier @crrobinson14 This took me hours to figure out. I had to go into the actual package to see how the styles were being applied. This is for But the only way to change the background color of the actual tab views that are for each scene in the bottom tab navigator is to pass a theme into the top level
In the above example Hope this helps! 😄 |
@LukeHamilton Thanks for that suggestion, I've tried out it and it works but it breaks other components in the hierarchy so it's still not a 100% solution. @crrobinson14 I've had a look for that setting, but it doesn't exist in bottom-tabs, only on drawerNavigator and materialTopTabNavigator. It seems like that's the ideal prop for this situation though, has it been left off bottom-tabs for a reason or has it just been overlooked in the v5 rewrite? It does seem very odd that there's no way to change the background colour of tab screens like you can in other navigators. |
I thought I'd have a go at implementing sceneContainerStyle into the bottom-tabs navigator. It's partially based on the drawer implementation, so you can still use a theme but also override using this prop's styles. Before I submit a PR, I thought I'd put it up here first to see if there's any glaring errors I've made. (see PR below - have submitted it under my personal account) If any maintainers see this, I'd be really keen to hear their feedback and if it's worth continuing with. |
This feature adds the sceneContainerStyle prop to the bottom-tabs navigator, to allow setting styles on the container's view. It's already implemented in the material-top-tabs and drawer navigators, I've simply ported it into the bottom-tabs navigator. It also fixes this issue: #8076 Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
This ticket can be closed now this PR has been merged. |
You saved my life buddy. |
This feature adds the sceneContainerStyle prop to the bottom-tabs navigator, to allow setting styles on the container's view. It's already implemented in the material-top-tabs and drawer navigators, I've simply ported it into the bottom-tabs navigator. It also fixes this issue: react-navigation/react-navigation#8076 Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
This feature adds the sceneContainerStyle prop to the bottom-tabs navigator, to allow setting styles on the container's view. It's already implemented in the material-top-tabs and drawer navigators, I've simply ported it into the bottom-tabs navigator. It also fixes this issue: react-navigation/react-navigation#8076 Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
This feature adds the sceneContainerStyle prop to the bottom-tabs navigator, to allow setting styles on the container's view. It's already implemented in the material-top-tabs and drawer navigators, I've simply ported it into the bottom-tabs navigator. It also fixes this issue: react-navigation/react-navigation#8076 Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
This feature adds the sceneContainerStyle prop to the bottom-tabs navigator, to allow setting styles on the container's view. It's already implemented in the material-top-tabs and drawer navigators, I've simply ported it into the bottom-tabs navigator. It also fixes this issue: react-navigation/react-navigation#8076 Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
Works on v6.x too:
|
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
this worked for me. |
For anyone who is struggling and none of the above worked, this is what worked for me:
|
Thanks!! |
Thanks a lot I have been putting this inside ScreenOptions |
Current Behavior
I'm not able to set the background color of the Tab Navigator screen to transparent, it instead shows the default gray background. I can set the tabbar component to transparent as seen in the screenshot (the color behind the tab navigator is black), but the screen does not do the same.
Expected Behavior
When setting the background to transparent for the tab navigator screen, it should show the color below the navigator (black in this case).
How to reproduce
Your Environment
The text was updated successfully, but these errors were encountered: