callstackincubator / rebolt-navigation

Fast and declarative router for Rebolt
https://rebolt-navigation.callstack.com/
MIT License
208 stars 11 forks source link

[StackNavigator] Styles are not applied to iOS built-in Header #89

Open knowbody opened 6 years ago

knowbody commented 6 years ago

It seems like the styles are not being applied to the built-in Header.

I tried something like this:

    <StackNavigator.Screen
      headerTitle="CustomTabBarExample"
      headerStyle=Style.(
                    style([elevation(0.), backgroundColor(String("#37bc9b"))])
                  )
      navigation=nav>
      /* ... */

this works on Android though, but while testing I also discovered I cannot change the title color. Is this something what I should be able to do or should I just provide my own center component?

grabbou commented 6 years ago

Probably need to move it to a different container. Let me take a look.

grabbou commented 6 years ago

Is this something what I should be able to do or should I just provide my own center component?

We can expose a tintColor property to make it possible to change the color of all the built-in components by default. Might be quite handy to tweak the appearance of the back button and others.

^ @satya164

knowbody commented 6 years ago

I don't think @satya164 accepted the invitation to this project

mciparelli commented 6 years ago

I have several nested stack navigators. For most of them, since we cannot remove headers I'm hiding them via styles in Android. Unfortunately I get a stack of headers in iOS since there's apparently no current way to hide them. Does anyone know of a workaround to control when headers should appear in iOS?

grabbou commented 6 years ago

That's an interesting use-case. I think it might be supported via custom headerComponent (provide something that renders empty View), but I am not sure if marginTop is not hardcoded.

We should definitely implement an easy way to use nested stack navigators and fix that thing on iOS.

Thanks for the report, we will look into that this week.