当我将导航器推送到MessageThread组件时,TabBarIOS仍在底部。我想每次去另一页都隐藏这个。
这是我的tabbarios:
<TabBarIOS selectedTab={this.state.selectedTab}>
<Icon.TabBarItemIOS
title="Messages"
iconName="ios-chatboxes-outline"
selected={this.state.selectedTab === 'Messages'}
onPress={() => {
this.setState({
selectedTab: 'Messages',
});
}}>
<NavigatorIOS style={styles.container}
initialRoute={{
title: 'Messages',
navigationBarHidden: false,
component: MessagesRecent
}}/>
</Icon.TabBarItemIOS>
<Icon.TabBarItemIOS
title="Groups"
iconName="ios-people-outline"
selected={this.state.selectedTab === 'Groups'}
onPress={() => {
this.setState({
selectedTab: 'Groups',
});
}}>
<NavigatorIOS style={styles.container}
initialRoute={{
title: 'Groups',
navigationBarHidden: false,
component: Groups
}}/>
</Icon.TabBarItemIOS>
</TabBarIOS>
onPress事件:
goToChat: function(){
this.props.navigator.push({
title: 'Messenger',
component: MessageThread,
passProps:{
navigator: this.props.navigator
}
});
}