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

Lightbox not rendered on top of initial scene (e.g not transparent) #2553

Closed
NathHorrigan opened this issue Oct 26, 2017 · 8 comments
Closed

Comments

@NathHorrigan
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux: ^4.0.0-beta.21
  • react-native: 0.48.3

Expected behaviour

Component to render on top of initial scene

Actual behaviour

Component renders like a normal scene on top of white view layer

Steps to reproduce

// index.js
<Router>
    <Lightbox>
        <Scene key="root" navBar={Navbar} setBarStyle={'blue'}>
            <Scene key="initial" initial={true} component={InitialPage} />
            // Rest of scenes
         </Scene>
         <Scene key="settings" hideNavBar={true} component={SettingsModal} />
    </Lightbox>
</Router>
// SettingsModal.js
<View style={{
    backgroundColor: 'rgba(0, 0, 0, 0.8)',
    width: '100%',
    height: '100%',
}}>  
    <Text>Hello, World</Text>   
</View>
@curliq
Copy link

curliq commented Oct 28, 2017

Having the same issue. Have you found a solution?

@NathHorrigan
Copy link
Author

NathHorrigan commented Oct 29, 2017

Nope - No response from the Gitter either. Do update the issue if you find one :)

@curliq
Copy link

curliq commented Oct 29, 2017

We have to wrap the Router with a View with flex 1, i.e.:

<View style={{flex:1}}>
<Router>
    <Lightbox>
        <Scene key="root" navBar={Navbar} setBarStyle={'blue'}>
            <Scene key="initial" initial={true} component={InitialPage} />
            // Rest of scenes
         </Scene>
         <Scene key="settings" hideNavBar={true} component={SettingsModal} />
    </Lightbox>
</Router>
</View>

@crazyhatfish
Copy link

That didn't work for me. I just had to set the lightbox view position to absolute:

      <View style={styles.container}>  
          <Text>Hello, World</Text>   
      </View>
  container: {
    backgroundColor: '#0000000A',
    position: 'absolute',
    top: 0,
    bottom: 0,
    left: 0,
    right: 0,
    justifyContent: 'center',
    alignItems: 'center',
  }

@NathHorrigan
Copy link
Author

@crazyhatfish Yep - that worked!!

@afilp
Copy link

afilp commented Feb 6, 2018

@crazyhatfish I use the "BaseLightbox" that the example has, which uses transparent but I only see a light gray as background. I do not see the contents of the previous screen behind the lightbox. Any ideas what should be changed? Thanks!

@diaraujo13
Copy link

@afilp Did you find a solution?

@reyanpapa17
Copy link

@aksonov I have the same issue with @afilp. Please assist us.

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

6 participants