2

Issue Description

I have TabBar base application, in one of my tab I need to push it to another screen but the tab bar should not display in the pushed screen. But the bottom bar is still existing in the pushed screen. What I want to achieved is not totally hide the bottom tab bar but to put the pushed screen on top of the tab bar.

Steps to Reproduce / Code Snippets / Screenshots

Here's my code to display the tab bar application:

bottomTabs: { id: 'BottomTabsId', children: [ { stack: { children: [ { component: { name: 'Home', options: { topBar: { backButton: { title: 'Back', }, title: { text: 'Home' } }, bottomTab: { fontSize: 12, text: 'Home', icon: require('./src/assets/home.png'), selectedIcon: require('./src/assets/home_active.png') }, }, }, } ] } }, { stack: { children: [ { component: { name: 'Booking', options: { topBar: { title: { text: 'Booking' } }, bottomTab: { text: 'Booking', fontSize: 12, icon: require('./src/assets/booking.png'), selectedIcon: require('./src/assets/booking_active.png') } } }, } ], }, }, ], },

image from ios The Tab bar is still existing :(

image from ios

What I want to achieve is this image from ios


Environment

  • React Native Navigation version: 2.0.2454
  • React Native version: 0.56
  • Platform(s) (iOS, Android, or both?): IOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator IOS 11
Sydney Loteria
  • 10,171
  • 19
  • 59
  • 73

3 Answers3

6

You need to push that screen with bottomTabs.visible: false option:

Navigation.push(this.props.componentId, {
  component: {
    name: 'your.component.name',
    options: {
      bottomTabs: {
        visible: false,
        drawBehind: true
      }
    }
  }
});
guy.gc
  • 3,359
  • 2
  • 24
  • 39
yogevbd
  • 1,548
  • 1
  • 14
  • 18
  • it doesn't work on both iOS and Android? Can you try using the latest `react-native-navigation`? – yogevbd Aug 16 '18 at 11:24
1

For android hide bottom tab in v2

componentDidMount() {
    Navigation.mergeOptions(this.props.componentId, {
        bottomTabs: {
          visible: false,
          drawBehind:true
        }
      });
}
Asha
  • 750
  • 1
  • 6
  • 22
0

I was also facing the same issue. I found a way to hide the tabs programmatically when pushing new screen.

You can hide tab in your newly pushed screen using. Write the below toggle inside constructor.

this.props.navigator.toggleTabs({
      to: 'hidden',
      animated: false,
    });
Vivek_Neel
  • 1,343
  • 1
  • 14
  • 25