【发布时间】:2019-07-15 11:56:59
【问题描述】:
我正在开发 react-native 移动应用。升级RN版本和react-native-router-flux ^4.0.6后。我正在使用类似于
]
它必须显示Tabs,标题为HOME,CATEGORIES,Success stories。但据观察,它不断获取抽屉的标题,标签看起来像这样Home,mainTitle,mainTitle。其中主标题是在抽屉上设置的标题。
只有显示正确的标签是带有初始标签的标签。
期望:标签将在抽屉下方的屏幕上显示其标题。 现实:每次都显示抽屉菜单的标题。 这是我的代码。
<Drawer
initial
navigationBarStyle={Styles.navigationBarStyle} key="drawer"
contentComponent={DrawerMenu} drawerWidth={220}
drawerIcon={<Icon name='menu' color={Colors.black} size={30}
style={{marginTop: Platform.OS === 'ios' ? -5 : 0}}
onPress={this.handleDrawerIconPress}/>}
title='main Title' rightTitle=' '
>
<Tabs
initial
tabBarPosition="top"
key="tabbar"
swipeEnabled
showLabel={false}
activeBackgroundColor={Colors.pink}
activeTintColor={Colors.pink}
inActiveTintColor={Colors.black}
inactiveBackgroundColor={Colors.black}
tabBarStyle={Styles.tabBar}
indicatorStyle={Styles.indicatorStyle}
iconStyle={Styles.iconStyle}
showIcon={true}
>
<Scene
initial
key="home"
component={Home}
icon={TabsIcon}
title="HOME"
iconName='home'
hideNavBar
/>
<Scene
key="categories"
component={Categories}
title="CATEGORIES"
icon={TabsIcon}
iconName='categories'
hideNavBar
/>
<Scene
key="success"
component={SuccessStories}
title="SUCCESS STORIES"
icon={TabsIcon}
iconName='success-stories'
hideNavBar
/>
</Tabs>
</Drawer>
【问题讨论】:
-
用tabBarLabel更改标题是否有效?
-
如果我使用 tabBarLabel 它什么也不显示。
-
如果你删除
showLabel={false}他们会出现 -
是的,我删除了 showlabel= {false} 但仍然没有影响
-
你能给我看一张抽屉照片吗?
标签: android reactjs react-native react-native-router-flux