-
Notifications
You must be signed in to change notification settings - Fork 3
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
isTranslucent method #12
Comments
'isTranslucent' method or a variable for StatusBar isn't what this library is for. Really sucks that it doesn't work for you currently in the base React Native library, but that's where it should be fixed. I didn't get the same impression as you might have gotten from the issue you just posted that they wouldn't fix it. Here's the code for StatusBar in RN it seems like it should work to me. I think you are understanding wrong how it works. You are setting the translucent prop to the StatusBar, thus "overriding" the behavior. It's up to you to store the isTranslucent-boolean somewhere, like in the component's state or some state management library of your choice. Minimal example: import { StatusBar, View } from 'react-native';
import React from 'react';
class MyApp extends React.Component {
constructor(props) {
this.state = {
translucentStatusBar: true,
}
}
render() {
return (
<View>
<StatusBar translucent={this.state.translucentStatusBar} />
</View>
);
}
} |
Oh thanks @jazmon so it always starts up in non-translucent mode huh? And then whenever I change it I can just keep track? Really appreciate the help here! |
By default it's not translucent, unless you give it the prop to tell it to be transulcent |
Thanks very much! |
May I please reuqest a
isTranslucent
method? Because i needed to detect if status bar is going to overlap or not. And there is a bug in RN implemtnation that is not being fixed:facebook/react-native#16432 (comment)
The text was updated successfully, but these errors were encountered: