ios - How to change the title of the NavigatorIOS without changing the route in React Native -


i have navigatorios , tabbarios in app. want change title of current route when tab selected.

the first way didn't work

while creating navigatorios, user variable @ state object updating state didn't change title. (even though render called again)

ontabchanged: function (title) {   this.setstate({     selectedtab: title,   }); },  render() {   return (     <navigatorios     ...     initialroute={{       component: tabs,       title: this.state.selectedtab,       passprops: {         ontabchanged: this.ontabchanged       }     }}     />   ); }, 

the second way didn't work

i tried updating state of the navigatorios referred nav. there routestack object in state of navigatorios keeps array of route items. updated array via setstate of navigatorios didn't work either.

the third way didn't work

i tried change title objective c native module couldn't reach specific navigation bar nsobject.

i hope can help.

i think you're supposed able navigator.replace @ moment replacement of title seems broken:

https://github.com/facebook/react-native/issues/476


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -