Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change react navigation's default back button Color on IOS header?

static navigationOptions = {
    headerTitle:'Booking',
    headerTitleStyle: {color:'white'},
    headerStyle: {backgroundColor:'orange'}
  }

My header looks like this. I want to change the color of default back button icon on IOS. I can change the color of the title, but there's no option to change the color of icon. I was wondering if there's a way to change the color or implementing my own headerLeft property is a better option?

like image 516
Saud Punjwani Avatar asked Aug 08 '17 14:08

Saud Punjwani


People also ask

How do I customize a header in react native?

To configure the header bar of a React Native application, the navigation options are used. The navigation options are a static property of the screen component which is either an object or a function. headerTitle: It is used to set the title of the active screen. headerStyle: It is used to add style to the header bar.


1 Answers

There is a property headerTintColor in navigationOptions which can be used to change the back button icon color

static navigationOptions = {
    headerTitle:'Booking',
    headerTitleStyle: {color:'white'},
    headerStyle: {backgroundColor:'orange'},
    headerTintColor: 'blue'
  }

Ref:https://reactnavigation.org/docs/navigators/stack#headerTintColor

like image 184
Ravi Raj Avatar answered Sep 28 '22 20:09

Ravi Raj