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

Is it possible to style toolbar(header) now? #30

Closed
pronevich opened this issue Jan 27, 2017 · 9 comments
Closed

Is it possible to style toolbar(header) now? #30

pronevich opened this issue Jan 27, 2017 · 9 comments
Labels

Comments

@pronevich
Copy link

pronevich commented Jan 27, 2017

Can't find any api for this purpose. Something like in react-native-navigator:

{
  navBarTextColor: '#000000', // change the text color of the title (remembered across pushes)
  navBarBackgroundColor: '#f7f7f7', // change the background color of the nav bar (remembered across pushes)
  navBarButtonColor: '#007aff', // change the button colors of the nav bar (eg. the back button) (remembered across pushes)
  navBarHidden: false, // make the nav bar hidden
  navBarHideOnScroll: false, // make the nav bar hidden only after the user starts to scroll
  navBarTranslucent: false, // make the nav bar semi-translucent, works best with drawUnderNavBar:true
  navBarTransparent: false, // make the nav bar transparent, works best with drawUnderNavBar:true,
  topBarElevationShadowEnabled: false, // Android only, default: true. Disables TopBar elevation shadow on Lolipop and above
  navBarNoBorder: false, // hide the navigation bar bottom border (hair line). Default false
  drawUnderNavBar: false, // draw the screen content under the nav bar, works best with   navBarTranslucent:true
}
@grabbou
Copy link

grabbou commented Jan 27, 2017

It's been just merged for the header -> a606073.

TabBar has it already -> see tabBarOptions.style https://reactnavigation.org/docs/navigators/tab

You can pass any style you want instead of using arbitrary properties which should make it easier to style and remember.

@satya164
Copy link
Member

We still need to support a tintColor for header to which styles the text and icon colors

@knowbody
Copy link

closing in favour of #36

@housseindjirdeh
Copy link

Forgive me if I'm doing something wrong, but since it's merged in for header can't we just add it to our Stack Navigation options?

const MyApp = StackNavigator({
  Login: {
    screen: LoginScreen,
  },
  Main: {
    screen: MainScreen,
    navigationOptions: {
      title: 'Title',
      header: {
        style: {
          backgroundColor: 'blue',
        },
      },
   },
  },
});

That doesn't seem to work for some reason 🤔

@satya164
Copy link
Member

@housseindjirdeh are you using from npm or github? I don't think it's published to npm yet

@housseindjirdeh
Copy link

@satya164 ah was just thinking that might be it, thanks so much mate appreciate it

@nonameolsson
Copy link

I am also having problems to get color to work. Isn't this feature published to npm?

@housseindjirdeh
Copy link

@nonameolsson Yep it's not published to npm yet, but you can get it from here instead (npm install --save https://github.com/react-community/react-navigation.git)

@nonameolsson
Copy link

@housseindjirdeh Thanks! I the documentation at https://reactnavigation.org up-to-date? Or does it match the version published to NPM?

ShyJuno pushed a commit to ShyJuno/react-navigation that referenced this issue Apr 19, 2024
prevent onRef callback be called twice on withNavigationFocus Components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants