我对基于当前选择的标签栏项目隐藏标签栏导航器很感兴趣。无论如何,我可以订阅更改选项卡事件吗?这是我当前的标签导航设置:
<TabNavigation
tabBarHeight={48}
tabBarStyle={this._getTabBarStyle(this.props)}
sceneStyle={this._getSceneStyle(this.props)}
id='main'
navigatorUID='main'
initialTab='catalog'
onRegisterNavigatorContext={() => {
console.log(this)
}}
>
<TabItem
id='catalog'
renderIcon={isSelected => {
if (isSelected) {
return <TabButton type='selectedCatalog' />
} else {
return <TabButton type='catalog' />
}
}} >
<StackNavigation initialRoute={Router.getRoute('catalog')} />
</TabItem>
<TabItem
id='notification'
renderIcon={isSelected => {
if (isSelected) {
return <TabButton type='selectedNotifications' />
} else {
return (
<View>
<TabButton type='notifications' />
</View>
)
}
}} >
<StackNavigation initialRoute={Router.getRoute('notification')} />
</TabItem>
<TabItem
id='redeem'
renderIcon={isSelected => {
if (isSelected) {
return <TabButton type='selectedRedeem' />
} else {
return <TabButton type='redeem' />
}
}} >
<StackNavigation initialRoute={Router.getRoute('redeem')} />
</TabItem>
</TabNavigation>