简体   繁体   中英

Hide navigation bar in NavigatorIOS component (react-native) doesn't work after RN update

I had recently upgraded my react native project from ~0.28 to the most recent version (0.43.2) and for some reason my navigation bar no longer hides for me.

Here is the code (it is sitting in a TabBarIOS component):

    <TabBarIOS.Item
      selected={this.state.selectedTab === 'home'}
      title='Home'
      icon={require ('./Icons/IconImages/HomeTabIcon.png')}
      onPress={
        () => this._tabPressed('home')
      }>
      <NavigatorIOS
        style={styles.container}
        ref="nav"
        interactivePopGestureEnabled={false}
        initialRoute={{
          title: 'Home',
          component: HomeNavigationController,
          navigationBarHidden: true, //this does nothing now
          showTabBar: false, //this is to hide the bottom tabBar
          passProps: {
            ...
          },
        }}/>
      </TabBarIOS.Item>

Adding it outside initialRoute also does not work:

          <NavigatorIOS
        style={styles.container}
        ref="nav"
        interactivePopGestureEnabled={false}
        initialRoute={{
          title: 'Home',
          component: HomeNavigationController,
          showTabBar: false,
          passProps: {...},
        }}
        navigationBarHidden={true} // does not work
        />

So, after trying to isolate the problem by stripping out everything and reducing it to its most basic form, I realized that it the problem wasn't in any code that I could find.

I initialized a new project from scratch and then re-added all my components and now it works just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM