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

NavBars won't "easily show/hide" (iOS 9.2) #80

Closed
andreasbhansen opened this issue Dec 16, 2015 · 4 comments
Closed

NavBars won't "easily show/hide" (iOS 9.2) #80

andreasbhansen opened this issue Dec 16, 2015 · 4 comments

Comments

@andreasbhansen
Copy link

Hey,

I cannot get the NavBars to show/hide on only some specific views.

An example where I would assume that the "launchpage" view would have its navbar hidden (because the Router says so), but the "loginpage" view navbar would be visible, because it says so. However, the navbar is hidden on all views when the hideNavBar={true} is set on the Router:

<Router hideNavBar={true} initialRoutes={['launchpage']}>
  <Route name="launchpage" component={LaunchPage} type="reset"/>
  <Route name="loginpage" component={LoginPage} hideNavBar={false} title="Login" schema="default"/>
</Router>

So I tried to remove hideNavBar={true} from the router, and set place hideNavBar={false} on the "loginpage" view, but then the navbar is shown on all pages, not only the "loginpage":

<Router initialRoutes={['launchpage']}>
  <Route name="launchpage" component={LaunchPage} type="reset"/>
  <Route name="loginpage" component={LoginPage} hideNavBar={false} title="Login" schema="default"/>
</Router>

I've also tried the showNavigationBar={true}, but it doesn't help solving this either. Any ideas here?

@aksonov
Copy link
Owner

aksonov commented Dec 16, 2015

It is known problem, see #72. Btw, you always could use own custom navbar and set it as header/footer for Route, and hide it when necessary.

@andreasbhansen
Copy link
Author

I'll definitely look into that!
And thanks for this contribution, makes life easier.

@andreasbhansen
Copy link
Author

@aksonov I'm having some really weird issues with the navigation bar. I can't really implement a custom one, because for some reason, with the following code, a navigation bar is present all the time within the "loggedinLayout" route group, even though hideNavBar={true}.

When it's set to hidden, the navigation bar is showing with the route name as title, and there is no back button when navigating the tabs (which is great!). However, if i set hideNavBar={false} on the "loggedinLayout", I'm able to style it the way I want, but then there's a backbutton (when navigating between tabs) I can't get rid of, I've tried the newer props like renderLeftButton and backButtonStyle but they have no effect.

EDIT:

OK, so renderBackButton is to be placed on a route, and takes a function returning the button:

  renderBackButton() {
    return <View></View>;
  }
<Route name="mainview"  key="1" renderBackButton={this.renderBackButton.bind(this)} ...... />

@aksonov
Copy link
Owner

aksonov commented Jan 12, 2016

hideNavBar now is supported for Route

@aksonov aksonov closed this as completed Jan 12, 2016
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

2 participants