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

Moving to a new scene pushesh navbar to the previous scene #2016

Closed
compojoom opened this issue Jul 12, 2017 · 3 comments
Closed

Moving to a new scene pushesh navbar to the previous scene #2016

compojoom opened this issue Jul 12, 2017 · 3 comments

Comments

@compojoom
Copy link
Contributor

The title might be confusing but stay with me :)

I have this v3 project that I'm migrating to v4.

In most of my views I've opted for custom navbar that I render myself in the component. This navbar display more information than just text. I needed to have several nested components. Anyway.

with v4 I'm noticing the following behavior.

Whenever I have a transition from a scene A that has a custom navbar to a scene B that uses the normal Navbar the following happens:
Scene A is pushed 60px down - the default Navbar is shortly displayed, then we get the animation for switching to scene B.

Is there a way to prevent this downshift when going to the next scene?

@aksonov
Copy link
Owner

aksonov commented Jul 12, 2017

Could you reproduce it with Example project? I need gif and link to fork of Example

@compojoom
Copy link
Contributor Author

I'm closing this for now as I can't reproduce it in an example project. Once I figure out what's going on and if it is reproducible I'll open a new issue.

Thanks for your help!

@compojoom
Copy link
Contributor Author

Actually just found what's going on. For other having the same issue check out the headerMode for your scenes. More info here: https://reactnavigation.org/docs/navigators/stack
headerMode - Specifies how the header should be rendered:

float - Render a single header that stays at the top and animates as screens are changed. This is a common pattern on iOS.
screen - Each screen has a header attached to it and the header fades in and out together with the screen. This is a common pattern on Android.
none - No header will be rendered.

It seems that for my project the default was float and that's why when you render your own header the reactnativation pushes it down, because it doesn't know that you have a header.

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