-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add headerLayoutPreset option to stack #4588
Conversation
NavigationPlayground for 383cc11 has been deployed.
|
383cc11
to
cef4b55
Compare
NavigationPlayground for cef4b55 has been deployed.
|
Codecov Report
@@ Coverage Diff @@
## master #4588 +/- ##
==========================================
- Coverage 67.92% 67.75% -0.17%
==========================================
Files 57 57
Lines 1799 1833 +34
==========================================
+ Hits 1222 1242 +20
- Misses 577 591 +14
Continue to review full report at Codecov.
|
cef4b55
to
7e8fa9c
Compare
NavigationPlayground for 7e8fa9c has been deployed.
|
7e8fa9c
to
6b11f93
Compare
NavigationPlayground for 6b11f93 has been deployed.
|
…nd make it have reasonable defaults, better back button ripple on Android
e493590
to
5f7cfc1
Compare
NavigationPlayground for 5f7cfc1 has been deployed.
|
NavigationPlayground for 5f7cfc1 has been deployed.
|
@brentvatne Is this in 2.9.1? I have it in my stack navigator but it is not positioned to the left.
|
it is not part of |
Oh thanks |
@brentvatne I always feel that the |
feel free to open a rfc to explain why you think that is the case: https://github.com/react-navigation/rfcs |
Can you updata Typescript definition ? Because TSLint can't find your new param :/ |
that saved my life |
I feel the same |
can you describe how that would work and why? seems pretty hard to
implement and the behavior is unclear. open a rfc and we can look into it!
…On Thu, Apr 25, 2019 at 08:34 Daniel Soto ***@***.***> wrote:
@brentvatne <https://github.com/brentvatne> I always feel that the
headerLayoutPreset configuration item should belong to navigationOptions.
I feel the same
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4588 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIYL7TUHATTRBEAZQL2C6BLPSHFQFANCNFSM4FHKHRYQ>
.
|
I wouldn't be able to tell you how because i haven't read the code of react-navigation but the why is quite simple since many of the header styling can be done on navigationOptions. I'll check the code later if i can, would be interesting to help on this. |
I am dealing with the same problem and I feel same way. I think that in my case for example, I just want to have one header in the whole app and I want to center the name and so I have no header configuration anywhere. The only config of stack I have is the bottom navigation, so now I just cannot center the title unless I use a dirt solution that is leaving blank the headerLeft with a View component. |
Don't know what an rfc is, but from a Developer Experience point of view, at least to me (as an inexperienced newbie), I agree it seems to make more sense for |
can you explain why it makes sense for you and what you'd expect to see
when transitioning when one screen in a stack has a certain header preset
and the next screen has a different one?
…On Wed, May 1, 2019 at 7:40 AM Edmund ***@***.***> wrote:
Don't know what an rfc is, but from a Developer Experience point of view,
at least to me (as an inexperienced newbie), I agree it seems to make more
sense for headerLayoutPreset to be part of navigationOptions.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4588 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIYL7TT4X4QEX4SJPNHUJNLPTGTUJANCNFSM4FHKHRYQ>
.
|
For me it makes sense because I am calling As I'm a newbie, the only transitioning I've actually seen of screens is slide/fade animations so in that scenario at least it wouldn't have an impact.
|
Would someone mind taking a look at this again? From what I am seeing the |
Adding it into stackConfig like this works for me, on both iOS and Android. Hope this helps! |
Thanks @andywu0408. I ran into this issue myself recently. The issue is that it's not part of |
Since React navigation 5 use headerTitleAlign:
Defaults to |
You can go this link : https://reactnavigation.org/docs/stack-navigator/#headertitlealign |
Documentation for version 6: https://reactnavigation.org/docs/elements/#headertitlealign |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Motivation
#4092
headerLayoutPreset: 'center' | 'left'
to provide an easy solution for questions like this.headerBackTitleEnabled
- this configuration option for stack navigator allows you to force back button titles to either be rendered or not (if you disagree with defaults for your platform and layout preset).