ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 415 forks source link

how can i hide the bar in the sub commponent #89

Closed jinghun1999 closed 6 years ago

jinghun1999 commented 8 years ago

i want to hide the tab bar in the sub commponent, but how? render() { let {tabBarShow} = this.props; return ( <View style={{flex: 1}}> <TabNavigator hidesTabTouch={true} sceneStyle={{paddingBottom: 0}} tabBarStyle={tabBarShow ? styles.tabNav : styles.tabNavHide}> {this._renderTabItem('ios-home', MY_HEALTH, this._createChildView(MY_HEALTH_CONSULT))} {this._renderTabItem('ios-book', MY_HEALTH_CONSULT, this._createChildView(MY_HEALTH))} {this._renderTabItem('ios-color-fill', MY_HEALTH_TOOLS, this._createChildView(MY_HEALTH_TOOLS))} {this._renderTabItem('ios-film', MY_HEALTH_COMMUNITY, this._createChildView(MY_HEALTH_COMMUNITY))} {this._renderTabItem('ios-person', MY_HEALTH_ACCOUNT, this._createChildView(MY_HEALTH_ACCOUNT))} </TabNavigator> </View> ); }

jinghun1999 commented 8 years ago

render() { let {tabBarShow} = this.props; return ( <View style={{flex: 1}}> <TabNavigator hidesTabTouch={true} sceneStyle={{paddingBottom: 0}} tabBarStyle={tabBarShow ? styles.tabNav : styles.tabNavHide}> {this._renderTabItem('ios-home', MY_HEALTH, this._createChildView(MY_HEALTH_CONSULT))} {this._renderTabItem('ios-book', MY_HEALTH_CONSULT, this._createChildView(MY_HEALTH))} {this._renderTabItem('ios-color-fill', MY_HEALTH_TOOLS, this._createChildView(MY_HEALTH_TOOLS))} {this._renderTabItem('ios-film', MY_HEALTH_COMMUNITY, this._createChildView(MY_HEALTH_COMMUNITY))} {this._renderTabItem('ios-person', MY_HEALTH_ACCOUNT, this._createChildView(MY_HEALTH_ACCOUNT))} ); }

jinghun1999 commented 8 years ago

why i can't insert the code with format ?

amzfcy commented 8 years ago

hello, i have the same problem.Do you have found the way? @jinghun1999

poberwong commented 8 years ago
render() { 
  let {tabBarShow} = this.props;
  return (
    <View style={{flex: 1}}>
      <TabNavigator
        hidesTabTouch={true}
        sceneStyle={{paddingBottom: 0}}
        tabBarStyle={tabBarShow ? styles.tabNav : styles.tabNavHide}
       > 
        {this._renderTabItem('ios-home', MY_HEALTH, this._createChildView(MY_HEALTH_CONSULT))} {this._renderTabItem('ios-book', MY_HEALTH_CONSULT, this._createChildView(MY_HEALTH))} {this._renderTabItem('ios-color-fill', MY_HEALTH_TOOLS, this._createChildView(MY_HEALTH_TOOLS))} {this._renderTabItem('ios-film', MY_HEALTH_COMMUNITY, this._createChildView(MY_HEALTH_COMMUNITY))} {this._renderTabItem('ios-person', MY_HEALTH_ACCOUNT, this._createChildView(MY_HEALTH_ACCOUNT))} 
      </TabNavigator>
    </View> 
  ); 
}

use code-block markdown syntax. your code should be shown like above @jinghun1999

yazhengwang commented 7 years ago

Did you has fixed ?

MarnoDev commented 7 years ago

在推入第二个页面时,把Navigation高度设置为0就可以了

When you push in the second page, the Navigation height is set to 0 on it

ptomasroos commented 6 years ago

Will close since this issue is more than a year, feel free to a open a new if this is still a issue.