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

When Close brings the StatusBar back #79

Open
beickon opened this issue Sep 5, 2017 · 6 comments
Open

When Close brings the StatusBar back #79

beickon opened this issue Sep 5, 2017 · 6 comments

Comments

@beickon
Copy link

beickon commented Sep 5, 2017

So in my app i'm taking off the StatusBar. When lightbox , the fade out animation brings it back :/

Is there a prop to keep the statusbar off?

@clementinoux
Copy link

clementinoux commented Sep 21, 2018

Hello @beickon ! Did you finally find a solution for this issue ? Thanks a lot

@peteroid
Copy link
Collaborator

peteroid commented Sep 21, 2018

Does this happen on Android but no iOS ? @clementinoux

@clementinoux
Copy link

clementinoux commented Sep 21, 2018

Actually, both @peteroid ! But temporarily for android (it appears and then disappears)

@peteroid
Copy link
Collaborator

@clementinoux as this repo uses <Modal /> for the overlay, you may try the suggestion from here react-native-modal/react-native-modal#50 (comment)

What you can try is to add a <StatusBar /> along with your lightbox children as following.

import Lightbox from 'react-native-lightbox';

const LightboxView = () => (
  <Lightbox>

    <StatusBar backgroundColor="rgba(0,0,0,0)"  barStyle="light-content"/>

    <Image
      style={{ height: 300 }}
      source={{ uri: 'http://knittingisawesome.com/wp-content/uploads/2012/12/cat-wearing-a-reindeer-hat1.jpg' }}
    />
  </Lightbox>
);

I don't get the code to test this out. You may share the code or try it yourself!

@clementinoux
Copy link

clementinoux commented Sep 22, 2018

Thanks for the code @peteroid but not working as expected. The status bar remains present on the other views of the app... I'm also using react-native-router-flux and also try some solutions like this one https://github.com/aksonov/react-native-router-flux/issues/699... Still not working...

@stokesbga
Copy link

Here ya go:

 _onOpen = () => {
    this.setState({ isOpen: true });
  };

  _onClose = () => {
    this.setState({ isOpen: false });
  };

  render() {
    return (
      <View>
        {this.state.isOpen && <StatusBar barStyle={"light-content"} />}
        <LightBox
          onOpen={this._onOpen}
          willClose={this._onClose}

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