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

Title is not vertically centered in <Navigator.NavigationBar> when using custom height #9174

Closed
jd327 opened this issue Aug 2, 2016 · 6 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@jd327
Copy link

jd327 commented Aug 2, 2016

When using custom height of 50, this is what I get for <Navigator.NavigationBar style={{height: 50}}> (as you can see it's not vertically centered):

normal

When using a negative marginTop to adjust both the back button and the title, it cuts off the top of the back button:

negative-margin

What's the proper way to fix this (preferably without negative margin)?

RN 0.30 / Mac OS X 10.11.5 / iPhone 6 / iOS 9.3

P.S: I could only find this other issue, but it's not too helpful: #3142

@ifours
Copy link

ifours commented Aug 16, 2016

You can try following workaround (you still need to use negative margin):

const navigationStyles = { ...Navigator.NavigationBar.StylesIOS };

navigationStyles.Stages.Left.LeftButton.overflow = 'visible';
navigationStyles.Stages.Center.LeftButton.overflow = 'visible';
navigationStyles.Stages.Right.LeftButton.overflow = 'visible';

navigationStyles.Stages.Left.RightButton.overflow = 'visible';
navigationStyles.Stages.Center.RightButton.overflow = 'visible';
navigationStyles.Stages.Right.RightButton.overflow = 'visible';

And pass as prop to your NavigationBar

@jd327
Copy link
Author

jd327 commented Aug 16, 2016

That did the trick @ifours, thank you! Not sure if I should close the issue tho... maybe the core team should still take a look (so we don't have to use a workaround + negative margins)?

@charpeni
Copy link
Contributor

@facebook-github-bot label Icebox

@charpeni
Copy link
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/title-is-not-vertically-centered-in-navigatornavigationbar-when-using-custom-height

ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

@charpeni
Copy link
Contributor

@facebook-github-bot close

@facebook-github-bot
Copy link
Contributor

@charpeni tells me to close this issue. If you think it should still be opened let us know why.

@facebook-github-bot facebook-github-bot added Ran Commands One of our bots successfully processed a command. Icebox labels Nov 14, 2016
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants