Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide TabBar Text in TabNavigator?

I'm using TabNavigator from 'react-navigation'. I want to hide or remove Text under icons.

enter image description here

Here is a part of TabNavigator. (I'm using Expo)

    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',

And this is CamaraScreen

class CameraScreen extends Component {
  static navigationOptions = {
    title: 'Camera'
  }
like image 943
merry-go-round Avatar asked Sep 16 '17 16:09

merry-go-round


People also ask

How do I hide a tab in navigation?

Press ⇧⌘A (macOS), or Ctrl+Shift+A (Windows/Linux), for the Find Actions dialog. From here you can search for Tab Placement, NBar and TBar to turn on or off the tabs, Navigation Bar and Toolbar windows.

How do I get rid of the tab bar icon in react native?

Customize the TabBar This property is commonly used to change the styles of the tab bar, for example, by applying the backgroundColor styles' property. To remove the border, add the tabBarOptions prop and inside it, add a style property called borderTopWidth with a value 0 .

How do I hide the header tab navigator react native?

x) add this code snipet "options={{headerShown: false}}" in "<Tab. Screen />". It will delete header of each tab you add into. Save this answer.


1 Answers

You can hide the label by specifying showLabel: false for the tabBarOptions object:

backBehavior: 'none',
tabBarOptions: {
    showLabel: false
}
like image 73
Kraylog Avatar answered Oct 18 '22 14:10

Kraylog