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
Support for hiding navigation header when headerMode: float
#53
Comments
Let's merge |
@ericvicenti ^ ? |
Only problem I see is that The animation for that isn't very easy.. what would it look like? |
@ericvicenti the only difference between them is when the animation is happening, right? it shouldn't be visible if changed just before the animation starts, .i.e when the state changes. |
To be clear, you are suggesting to have the floating header simply hide when the next Depending on the animation implementation, B might be quite nice. |
Working on a similar transition, I would love to see B implemented |
i would like to be able to hide the header when the mode is float. we could just have it as is now, and just enable the hiding. i guess thats simpler than the suggestions above. |
With react-router-flux it was working quite well for my use case: Starting of with no header visible on the main screen. Then navigate to the next screen by using the "screen mode animation", which will have a header. All animations ontop of this view are of type "float" then |
yea i was using react native router flux too. feels more native now, but also feels weirdly set up. the api of flux is better I think. I like some stuff here but even though this is muuuuuch better than previous navigator attempts, it still feels half way there. I guess it will get better with time :) |
Anyone see any problems with using this hack in order to hide the header on a specific view? |
@mdramos I gave that a try, and it shifted down the content of the hidden header page during the animation. |
I'll be working on this in the morning. I'll keep you posted! |
Having worked on this today I think it needs some further discussion. To fit into what's already in the code I worked on a method named "shouldEmbedHeader" which determines whether the header should float outsides all scenes or sit inside the current scene depending on the navigationOptions of the current scene and the one previously shown. When we transition from There's various edge cases to deal with so it's not ready to release but I'm concerned that it already feels very much like a hack so I'd like to get some thoughts from the core developers. |
...to be clear I'm attempting to allow any combination of modes and visible header and allowing for modal as we can natively. |
There are may hacks
|
|
complete solution:
auth: (shows no header)
login: (shows header) |
@fritz-c did you find a solution? or switched to another navigation library? |
check out this example: https://github.com/react-navigation/react-navigation/blob/master/examples/NavigationPlayground/js/StackWithHeaderPreset.js you can hide header on specific screens and it will transition as expected between header/no header |
This comment has been minimized.
This comment has been minimized.
Why is this issue closed? on Android the header is still shown even thou I set header: () => null (just setting it to null will throw errors for me). the screen is moved up as id there where no header when I set this but the floating header is still visible.
@lprhodes Could there be some clarification as to how to hide a header that works with headerMode = 'float'? |
I've tried to use this on the screen that overrides the float header... but doesn't works! any workaround for this in v5??? |
Currently it's supported only with
headerMode: screen
. We should support it onfloat
also and hide the header with animation.The text was updated successfully, but these errors were encountered: