Search code examples
react-nativereact-native-router-flux

Is it possible to change the navigationBarStyle on runtime in react-native-router-flux?


I want to change the background color of the navigation bar while opening the the scene.

I tried to achieve it by this but it doesn't work.

Actions.scene({navigationBarStyle:{backgroundColor:'red'}});

And this gives syntax error

Actions.scene({navigationBarStyle:{{backgroundColor:'red'}}});

Any ideas?


Solution

  • Try changing the prop navigationBarStyle to headerStyle.

    Actions.scene({headerStyle:{backgroundColor:'#FF0000'}});