3

i am troubling using of NavigatorIOS in react native,

<NavigatorIOS
      style={styles.navigator}
      initialRoute={{
        title:’xxx’,
        component:xxx
      }}/>

here component xxx is my starting file here i don’t want navigator,after this i am using login screen there also i don’t want navigator after completion of the these screens,I need a navigator in my screen. How can i hide the Navigator for these screens any help much appreciated

Hussian Shaik
  • 2,559
  • 9
  • 37
  • 57
  • Possible duplicate of [how to show the hidden navbar in react native](http://stackoverflow.com/questions/33017090/how-to-show-the-hidden-navbar-in-react-native) – Hamed Tabatabaei Mar 30 '16 at 15:52
  • If you are using StackNavigator then check this. http://stackoverflow.com/questions/30202705/how-to-hide-react-native-navigationbar/43935245#43935245 – Naeem Ibrahim May 12 '17 at 10:23

2 Answers2

1
<NavigatorIOS
  style={styles.navigator}
  initialRoute={{
    title:'xxx',
    component:xxx
  }}
  navigationBarHidden={true} />
KChen
  • 1,922
  • 14
  • 15
  • hidding is ok but in third screen i kept like this this.props.navigator.push({ component:xxxx title:’xxxx’, navigationBarHidden:false })but not working,ineed to show navbar there – Hussian Shaik Oct 08 '15 at 11:56
  • You can send props in a component using passProps:{..}. I don't think you can use this.props.navigator.push({ component:xxxx title:’xxxx’, navigationBarHidden:false }) – Nishanth Shankar Oct 08 '15 at 15:02
  • @HussianShaik navigationBarHidden is a prop of NavigatorIOS, not Router. – KChen Oct 09 '15 at 05:57
  • Please consider editing your post to add more explanation about what your code does and why it will solve the problem. An answer that mostly just contains code (even if it's working) usually wont help the OP to understand their problem. – Miki Oct 11 '15 at 20:23
1

Have you tried changing the navigationBarHidden value with a state

<NavigatorIOS
  style={styles.navigator}
  initialRoute={{
  title:'xxx',
  component:xxx
 }}
 navigationBarHidden={this.state.navHidden} />

Now set the state to true or false based on your screen. You might have to make the props bubble up to the parent Navigator.

Nishanth Shankar
  • 1,966
  • 1
  • 14
  • 19