Git Product home page Git Product logo

Comments (14)

grabbou avatar grabbou commented on April 20, 2024 6

That sounds to me like a good first task.

from react-navigation.

grabbou avatar grabbou commented on April 20, 2024 6

There's already tintColor prop on a back button that is applied.

from react-navigation.

guigrpa avatar guigrpa commented on April 20, 2024 6

May I ask: why a single color to tint header title and back icon/label? In the standard header, the title is black and the back button is blue (on iOS). I'd like to change the back button color, is there some prop to do that?

from react-navigation.

Ehesp avatar Ehesp commented on April 20, 2024 1

Okay sounds good, will see if I can get this in within the next few hours.

from react-navigation.

davidcort avatar davidcort commented on April 20, 2024 1

There's already tintColor prop on a back button that is applied.

<HeaderBackButton tintColor = '#fff' onPress={() => navigation.goBack(null)} />

Thanks, works !!

from react-navigation.

Ehesp avatar Ehesp commented on April 20, 2024

If someone can explain what the best naming convention for styling all of the components would be this should be fairly straightforward.

  1. Title/text colour
  2. Back arrow tint colour

Anymore? E.g. Would titleStyle and tintColor as 2 individual props on header be ok?

Cc @satya164

from react-navigation.

satya164 avatar satya164 commented on April 20, 2024

We should add a single tintColor property which sets color for both title and back button.

from react-navigation.

Ehesp avatar Ehesp commented on April 20, 2024

@grabbou from the looks of it though the Header class only applies the onPress prop. On my phone so could be wrong but will check it out soon.

from react-navigation.

satya164 avatar satya164 commented on April 20, 2024

The BackButton accepts the prop, but Header component doesn't accept such an prop, and the screen navigation options aren't passed either.

from react-navigation.

Ehesp avatar Ehesp commented on April 20, 2024

@satya164 @grabbou

I'm applying tintColor to my navigationOptions.header like so:

header: ({ state }) => {
      return ({
        title: 'Some title',
        tintColor: '#ffffff',

However, when logging out header & props here, it logs twice directly after each other (double re-render or previous scene => new scene??). The first time header does not contain my prop, second time it does, but misses the left property.

Is this correct?

return renderLeftComponent(props);

This passes in props, but does not include the tintColor prop - apologies I'm a bit confused as to how to get this from within the renderLeftComponent.

from react-navigation.

satya164 avatar satya164 commented on April 20, 2024

Your usage looks correct. But hold off a bit since @grabbou is doing some refactors right now.

it logs twice directly after each other (double re-render or previous scene => new scene??). The first time header does not contain my prop, second time it does, but misses the left property.

I'm not fully sure, but I think it might be related to #48

from react-navigation.

jsdario avatar jsdario commented on April 20, 2024

API seems to have changed in 1.0.0-beta, is there a way to use tintColor from navigationOptions = ({navigation}) { ... } ?

from react-navigation.

grabbou avatar grabbou commented on April 20, 2024

Yeah, just return headerTintColor and you are done.

from react-navigation.

UdaySubbisetty avatar UdaySubbisetty commented on April 20, 2024

There's already tintColor prop on a back button that is applied.

<HeaderBackButton tintColor = '#fff' onPress={() => navigation.goBack(null)} />

from react-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.