Skip to content

Conversation

agarant
Copy link
Contributor

@agarant agarant commented Apr 6, 2020

Currently it was not possible to set a title color different than the tint color. This PR keeps the tintColor as the default header title color but also uses the headerStyle.color if defined.

@Collin3
Copy link

Collin3 commented Apr 20, 2020

I think you should be able to achieve this by setting your screen options to something like the object below. This is how I was able to style the back button, but set the title text to a different color. I'm using the latest version (2.5.0).

{
  headerTintColor: yourTintColorHere,
  headerTitleStyle: {
    color: yourTitleColorHere
  }
}

@agarant
Copy link
Contributor Author

agarant commented May 1, 2020

@Collin3 Thanks for suggesting a workaround.

However, I still think that the fix is relevant as it is makes the api more intuitive and consistent. @WoLewicki do you mind taking a quick look at it. It is a 1 line PR. :)

@WoLewicki
Copy link
Member

Thanks for your contribution! Looks good, I am merging it.

@WoLewicki WoLewicki merged commit 26b9376 into software-mansion:master May 4, 2020
@agarant agarant deleted the fix/support-title-color branch May 4, 2020 12:25
@hirbod
Copy link
Contributor

hirbod commented May 5, 2020

Maybe a hint in the native-stack readme?

@WoLewicki
Copy link
Member

Could someone make a PR with an update to the README and screens.d.ts that it would properly show the available options based on createNativeStackNavigator.js? I would love to merge a PR with it.

@agarant
Copy link
Contributor Author

agarant commented May 6, 2020

@WoLewicki of course, I can make the update in #454, updating the required docs and types for the largetTitle property at the same time.

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

Successfully merging this pull request may close these issues.

4 participants