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

[Android] navigationBar title is not in the middle #3142

Closed
timzaak opened this issue Sep 30, 2015 · 8 comments
Closed

[Android] navigationBar title is not in the middle #3142

timzaak opened this issue Sep 30, 2015 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@timzaak
Copy link

timzaak commented Sep 30, 2015

this is the demo https://rnplay.org/apps/egL8Cw.

@timzaak timzaak changed the title navigationBar title is not in the middle [Android] navigationBar title is not in the middle Sep 30, 2015
@satya164
Copy link
Contributor

You have to adjust the margin to center it vertically. Also, about removing the left margin, if you do that, it'll overlap any buttons on the left.

I'm wondering why flexbox is not used to align the buttons and titles instead of absolute positioning.

@timzaak
Copy link
Author

timzaak commented Sep 30, 2015

@satya164 I just make it like ios. And I use marginTop to make the title center vertically

@brentvatne
Copy link
Collaborator

https://github.com/facebook/react-native/blob/master/Libraries/Components/Navigator/NavigatorNavigationBarStyles.android.js

This is intentional, based on platform specific ui differences. #3028 makes it possible to use iOS navbar styles on Android and vice versa.

@RishiSa
Copy link

RishiSa commented Dec 26, 2015

Thank you .It's worked for me.

@techrah
Copy link

techrah commented Jun 13, 2016

@brentvatne What are the platform specific UI differences that you are referring to regarding this issue? I am not very familiar with Android UI but from what I understand, there is a navigation stack that is maintained when an intent starts a new activity but there is no standard navigation bar with a title and back button as there is in iOS. So why is it that the title is not centred by default like in iOS?

@satya164
Copy link
Contributor

@ryanhomer https://material.google.com/layout/structure.html#structure-app-bar

@mehdipourfar
Copy link

mehdipourfar commented Nov 9, 2016

The problem still exists. After wasting 2 hours of my time trying to debug my styles, I had to resort to this quick fix for solving it.

http://stackoverflow.com/questions/35867954/changing-the-default-style-for-a-navigator-navigationbar-title

@timzaak
Copy link
Author

timzaak commented Nov 10, 2016

@mehdipourfar if you do as

<Navigator.NavigationBar
  navigationStyles={Navigator.NavigationBar.StylesIOS}
/>

it works for me.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants