Title is not vertically centered in <Navigator.NavigationBar> when using custom height
See original GitHub issueWhen 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):
When using a negative marginTop
to adjust both the back button and the title, it cuts off the top of the back button:
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: https://github.com/facebook/react-native/issues/3142
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Why my react native navigation bar's text not on the vertical ...
I just ran into this issue too. The solution: <Navigator.NavigationBar routeMapper={{ Title: (route, navigator, index, navState) => { return ...
Read more >iOS 16 Beta Vertically Aligns Navi… | Apple Developer Forums
On iOS 16, I noticed that the navigation bar title view is being aligned vertically to the top, I cannot figure out why....
Read more >How to Vertically Center Text with CSS - W3Docs
To position text vertically positioned with CSS you can use vertical-align, line-height, transform properties, flexbox. Learn more methods. Try examples.
Read more >Navbar | Webflow University
The height of the navbar is determined by the content inside — either the height of the brand logo or the height of...
Read more >Styling your Navigation - Adobe Portfolio
Set a Navigation height (this will also determine the height of your logo); Vertically Align your navigation elements (Page titles, social icons ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can try following workaround (you still need to use negative margin):
And pass as prop to your
NavigationBar
@charpeni tells me to close this issue. If you think it should still be opened let us know why.