Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

hack to hide navbar #285

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

philipheinser
Copy link
Contributor

No description provided.

@sibelius
Copy link
Contributor

sibelius commented Dec 1, 2016

can't u do something like this:

static route = {
    navigationBar: {
      visible: false,
    },
}

@philipheinser
Copy link
Contributor Author

@sibelius I need to show and hide the navigator in the same scene. The method you mentioned is dynamic isn't it?

@sibelius
Copy link
Contributor

sibelius commented Dec 2, 2016

it is not dynamic, I think it makes sense to have a hideNavigationBar method on this.props.navigator instead of this

@philipheinser
Copy link
Contributor Author

@sibelius Agree. This was just a quick hack that we used to solve this #283

@sibelius
Copy link
Contributor

sibelius commented Dec 2, 2016

#89 (comment)

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>
    )
}

@brentvatne
Copy link
Member

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

@JulianKingman
Copy link

JulianKingman commented Jan 8, 2017

@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).

@sibelius
Copy link
Contributor

sibelius commented Jan 8, 2017

I made another NavigationBar based on ex-navigation NavigationBar that only require Title, left and right button

@JulianKingman
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants