ex-navigation
ex-navigation copied to clipboard
hack to hide navbar
can't u do something like this:
static route = {
navigationBar: {
visible: false,
},
}
@sibelius I need to show and hide the navigator in the same scene. The method you mentioned is dynamic isn't it?
it is not dynamic, I think it makes sense to have a hideNavigationBar
method on this.props.navigator
instead of this
@sibelius Agree. This was just a quick hack that we used to solve this #283
https://github.com/exponentjs/ex-navigation/issues/89#issuecomment-254920193
I think the best solution for your use case right now, is to have navigationBar: { visible: false } and render a navigationBar inside the render of your own component
so u can have more control of when to render it or not
like this:
render() {
const navBar = this.state.navBarVisible ? this._renderNavBar() : null;
return (
<View>
{navBar}
{this._renderContent()}
</View>
)
}
interesting! i'd be open to making the visible
property either be a bool or a fn that accepts route obj similar to title and renderRight/renderLeft, that should solve the problem
@sibelius regarding your workaround (this._renderNavBar()
), is the best way to create something that looks like a navbar, or to import it? I'm having a tough time setting the correct props for <NavigationBar />
imported from ex-navigation (specifically, it asks me for scenes, getBarStyle and navigation state, the later of which I figured out, there are probably more).
I made another NavigationBar based on ex-navigation NavigationBar that only require Title, left and right button
I don't suppose you have that around somewhere that I could look at? I'm ending up stripping pretty much everything and recreating it completely.