0

Is that possible to change icon in react-native-navigation tabbar?
I mean for example somewhere in my application i did call to api and after response came I need to change my Icon in tab bar to new one.
for example Heart icon to Mail Icon.

Appreciate any kind of help!

Андрей Гузюк
  • 2,134
  • 6
  • 29
  • 53

1 Answers1

7

Use setTabButton

this.props.navigator.setTabButton({
  tabIndex: 0, // (optional) if missing, the icon will be added to this screen's tab
  icon: require('../img/one.png'), // local image asset for the tab icon unselected state (optional)
  selectedIcon: require('../img/one_selected.png'), // local image asset for the tab icon selected state (optional, iOS only)
  label: 'New Label' // tab label that appears under the icon (optional)
});
PTT
  • 654
  • 5
  • 6