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

change text color of title elements for a scene


I'm creating a small Android mobile app using React Native and react-native-router-flux.

I've customized everything except the leftTitle and rightTitle property of my main screen. I can name them, but I can't style them. They remain this blue color as seen in the image below.

enter image description here

Here is the code for that scene:

<Scene
  rightTitle="Add"
  onRight = { () => Actions.employeeCreate() }
  key="employeeList"
  component={EmployeeList}
  title="Employees"
  leftTitle="Log Out"
  onLeft={ () => logUserOut() }
  initial
/>

Does anyone know how to change the color of the title text?

Thanks!


Solution

    1. Find react-native-router-flux folder in node modules
    2. Navigate into react-native-router-flux > src > NavBar.js
    3. Edit color style barRightButtonText and barLeftButtonText in StyleSheet like this

    For right button text :

     barRightButtonText: {
        color: 'rgb(0, 122, 255)',    //Your rgb color code here
        textAlign: 'right',
        fontSize: 17,
      },
    

    For left button text

     barLeftButtonText: {
        color: 'rgb(0, 122, 255)',  //Your rgb color code here
        textAlign: 'left',
        fontSize: 17,
      },