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

Color of Back Button Arrow #2028

Closed
luco opened this issue Jul 13, 2017 · 28 comments
Closed

Color of Back Button Arrow #2028

luco opened this issue Jul 13, 2017 · 28 comments

Comments

@luco
Copy link
Contributor

luco commented Jul 13, 2017

I'm trying to change the color of back button arrow, but still not getting it.

var sceneConfig = {
  navigationBarStyle: {backgroundColor: 'black'},
  headerTitleStyle: {
      color: 'white',
      fontWeight: '500'
  },
  headerBackTitleStyle: {
    color: 'white',
  },
  headerTintColor: 'white',
  cardStyle: {
        backgroundColor: 'white'
  }
}

The color of back button label I had success, but not on arrow.

Tips?

aksonov added a commit that referenced this issue Jul 14, 2017
- Enhancement: support inheritance of scene props (useful for `headerMode` attribute for different RN StackNavigator animation)
- Fix: attempt to fix react-navigation pushes instead of jumping when user taps the same tab (#2024)
- Enhancement: use navBarButtonColor or tintColor or headerTintColor for image button tintcolor (#2028)
- Fix: use backBehavior='initialRoute' by default (#2026)
- Enhancement: allow right/leftTitle, right/leftButtonImage to be static functions within scene component
- Enhancement: allow wrapping all screens and navbar buttons with `wrapBy` parameter for `Router`. It could be `observer` from MobX, or `connect` from Redux or any other function.
- Fix: eslint formatting, fix CircleCI build
@aksonov
Copy link
Owner

aksonov commented Jul 14, 2017

Please check beta.9 - you have to use navBarTintColor or navBarButtonImageColor or tintColor property.

@luco
Copy link
Contributor Author

luco commented Jul 14, 2017

@aksonov Thanks a lot!

@luco luco closed this as completed Jul 14, 2017
@luco luco reopened this Jul 14, 2017
@luco
Copy link
Contributor Author

luco commented Jul 14, 2017

@aksonov Just updated. Tried all the options, but still not getting it:

var sceneConfig = {
      navigationBarStyle: {'black'},
      headerTitleStyle: {
          color: 'white',
          fontWeight: '500'
      },
      tintColor: '#fff',
      navBarTintColor: '#fff',
      navBarButtonImageColor: '#fff',
      headerTruncatedBackTitle: 'Voltar',
      headerBackTitleStyle: {
        color: 'white',
      },
      cardStyle: {
            backgroundColor: 'white'
      }
    }

@aksonov
Copy link
Owner

aksonov commented Jul 14, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 14, 2017

@aksonov Getting this error:

image

@aksonov
Copy link
Owner

aksonov commented Jul 14, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 14, 2017

@aksonov Tried all the options and didn't get it. What's the correct param?

@aksonov
Copy link
Owner

aksonov commented Jul 15, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 16, 2017

I tried everything, specially using tintColor as you used on the example, but it didn't work.
<Router createReducer={reducerCreate} tintColor='yellow'>

@aksonov
Copy link
Owner

aksonov commented Jul 16, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 16, 2017

Yes, I do. But when I try to apply on my Router, it doesn't work. In fact, it works on my modals, but not on my card stack.

@aksonov
Copy link
Owner

aksonov commented Jul 16, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 16, 2017

On example, it works. But not on my project. I'm setting this way:

  <Router createReducer={reducerCreate} tintColor='white'>

            <Scene key="modal" modal hideNavBar tintColor='white'>
                <Scene key="root" hideNavBar tintColor='white'>
                  <Scene key="tabbar" 
                  tabs 
                  showLabel={false} 
                  tintColor='white'
                  tabBarComponent={this.tabBarElement}
                  headerBackTitle={'Back'}
                 >

As you can see, I tried on every element.
image

@aksonov
Copy link
Owner

aksonov commented Jul 16, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 16, 2017

But backTitle sets the text, right?

EDIT
When I set the backTitle, it works, but text becomes blue:
image

@aksonov
Copy link
Owner

aksonov commented Jul 16, 2017 via email

@luco
Copy link
Contributor Author

luco commented Jul 16, 2017

I thought as well, so I removed react-navigation from my project and it still not working. It's annoying me.

@luco
Copy link
Contributor Author

luco commented Jul 16, 2017

I can get the color on inspector:

image

@luco
Copy link
Contributor Author

luco commented Jul 17, 2017

I managed to work. Digging into your code I found that setting navBarButtonColor works for setting the tint color for the back arrow.

Thanks for your attention.

@luco luco closed this as completed Jul 17, 2017
@Norfeldt
Copy link

Norfeldt commented Oct 1, 2017

Would you mind sharing a code snippet of the solution? I can't seem to make it work..

screen shot 2017-10-01 at 20 06 25

screen shot 2017-10-01 at 20 07 43

import React, { Component } from 'react'
import { AppRegistry, Text } from 'react-native'
import { Router, Stack, Scene } from 'react-native-router-flux'
import Events from './src/components/Events'
import Details from './src/components/Details'

const App = () => (
  <Router
    navigationBarStyle={{ backgroundColor: '#669966' }}
    titleStyle={{
      fontFamily: 'Pacifico-Regular',
      fontSize: 22,
      color: '#003300',
    }}
    navBarButtonColor={{ color: '#003300' }}
  >
    <Stack key="root">
      <Scene init key="events" component={Events} title="Event Expert" />
      <Scene key="details" component={Details} title="Details" />
    </Stack>
  </Router>
)

AppRegistry.registerComponent('EventExpert', () => App)

@ghost
Copy link

ghost commented Oct 5, 2017

@Norfeldt write navBarButtonColor='#003300' instead of navBarButtonColor={{ color: '#003300' }} and it's gonna work

@Daredevll
Copy link

navBarButtonColor='#ffffff' does not work for me, tried all the options/variants mentioned above.

@MattyK14
Copy link

@Daredevll applying just tintColor worked for me.

@dev-flc
Copy link

dev-flc commented Mar 15, 2018

Solution :)

barButtonIconStyle={{ tintColor: 'red' }}

EXAMPLE
<Router renderLeftButton={data} barButtonIconStyle={{ tintColor: 'red' }} navigationBarStyle={styles.navigationBarStyle} titleStyle={styles.title}> <Scene key="root" > .... ? </Scene> </Router>

@rsp8055
Copy link

rsp8055 commented Mar 23, 2018

titleStyle={{
fontFamily: 'Pacifico-Regular', // fontFamily: 'Filson_Soft_W03_Book',
fontSize: 22,
color: '#3300',
}}

fontFamily is not working, why?

@albertoarraco
Copy link

Have you imported the font 'Pacifico-Regular' in your project?

@rsp8055
Copy link

rsp8055 commented Apr 4, 2018

Yes, I have. I just found that any fontFamily is not applicable to the title of the nav bar.

@kallayyash
Copy link

But backTitle sets the text, right?

EDIT
When I set the backTitle, it works, but text becomes blue:
image

use : headerTintColor="black"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants