如何在 TabNavigator 中隐藏 TabBar 文本?
How to hide TabBar Text in TabNavigator?
我正在使用 'react-navigation' 的 TabNavigator。我想隐藏或删除图标下的文本。
这是 TabNavigator 的一部分。 (我正在使用世博会)
Camera: {
screen: CameraScreen,
},
Noti: {
screen: NotificationScreen,
},
Menu: {
screen: MenuStackNavigator,
},
},
{
navigationOptions: ({ navigation }) => ({
header: null, <<<
tabBarIcon: ({ focused }) => {
...
},
}),
header: null, <<<-
headerMode: 'none', <<--
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: false,
backBehavior: 'none',
这是 CamaraScreen
class CameraScreen extends Component {
static navigationOptions = {
title: 'Camera'
}
您可以通过为 tabBarOptions
对象指定 showLabel: false
来隐藏标签:
backBehavior: 'none',
tabBarOptions: {
showLabel: false
}
我正在使用 'react-navigation' 的 TabNavigator。我想隐藏或删除图标下的文本。
这是 TabNavigator 的一部分。 (我正在使用世博会)
Camera: {
screen: CameraScreen,
},
Noti: {
screen: NotificationScreen,
},
Menu: {
screen: MenuStackNavigator,
},
},
{
navigationOptions: ({ navigation }) => ({
header: null, <<<
tabBarIcon: ({ focused }) => {
...
},
}),
header: null, <<<-
headerMode: 'none', <<--
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: false,
backBehavior: 'none',
这是 CamaraScreen
class CameraScreen extends Component {
static navigationOptions = {
title: 'Camera'
}
您可以通过为 tabBarOptions
对象指定 showLabel: false
来隐藏标签:
backBehavior: 'none',
tabBarOptions: {
showLabel: false
}