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

IOS: setting scene backgroundColor to transparent not working #3182

Closed
esanguinetti opened this issue Aug 14, 2018 · 3 comments
Closed

IOS: setting scene backgroundColor to transparent not working #3182

esanguinetti opened this issue Aug 14, 2018 · 3 comments

Comments

@esanguinetti
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.1 (v3 is not supported)
  • react-native v0.55.4

Expected behaviour

Scene backgroundColor transparent on IOS

Actual behaviour

Scene backgroundColor is black on IOS.
The solution referenced in #2809
did not seem to work.

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
1.<Router getSceneStyle={() => ({
backgroundColor:'transparent',
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0})}>
<Scene..>
<Scene..>

2.
3.

@marcosmartinez7
Copy link

Same problem here!

@mwskwong
Copy link

mwskwong commented Aug 18, 2018

This is because the transition config of react navigation (that's what this library based on) has set a black bg in default when the OS is ios. To solve that:

transitionEffect = () => ({
        containerStyle: {
            backgroundColor: "transparent"
        }
});

// some code...

<Stack
    key="rootStack"
    transitionConfig={this.transitionEffect}
>
 // some code ...
</Stack>

@daviscabral
Copy link
Collaborator

daviscabral commented Aug 18, 2018

That's not an issue on RNRF, but might be fixed setting the opacity for your container:

        containerStyle: {
            backgroundColor: "transparent",
            opacity: 1
        }

Please reopen in case it not fix your problem.

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