React-native-navigation: tabBarHidden and navBarHidden is not working in both platform

Created on 15 May 2018  路  3Comments  路  Source: wix/react-native-navigation

Steps to Reproduce / Code Snippets / Screenshots

I have set tabBarHidden: true and navBarHidden: true inside startTabBasedApp as following:

Navigation.startTabBasedApp({
    tabs: [
      {
        screen: 'screens.Home',
        icon: LocalImages.Tabs.Home,
      },
      {
        screen: 'screens.Album',
        icon: LocalImages.Tabs.Album,
      }
    ],
    appStyle: {
      orientation: 'portrait',
      navBarHidden: true,
      tabBarHidden: true
    }
  });

I have also set navigatorStyle inside HomeScreen as following:

import React, { Component } from 'react';
import { View } from 'react-native';

export default class HomeScreen extends Component {
  static navigatorStyle = {
    tabBarHidden: true
  };

  constructor(props) {
    super(props);

    this.props.navigator.setStyle({
      tabBarHidden: true
    });
  }

  render() {
    return (
      <View style={{flex: 1, backgroundColor: '#f00'}}>
      </View>
    );
  }

Still the whole tabBar didn't hide completely, with some white space left:

simulator screen shot - iphone x - 2018-05-15 at 16 02 57

For the navBarHidden, it works fine in IOS but not in Android except I set it inside every page:

screenshot_2018-05-15-16-09-29

Someone please help!

Environment

  • React Native Navigation version: 1.1.458
  • React Native version: 0.52.0
  • Platform(s) (iOS, Android, or both?): both
  • Device info (Simulator/Device? OS version? Debug/Release?): All IOS and Android devices
questiostack overflow

Most helpful comment

I got the same issue.
Doesn't work:

static  navigatorStyle = {
    navBarHidden: true
  }

Works:

  componentWillMount() {
    this.props.navigator.setStyle({
      navBarHidden: true
    })
  }

All 3 comments

@guyca It's a bug. I would like to know the reason why you want me to ask and search inside stack overflow?

@guyca so this is actually not a bug in react-native-navigation?

I got the same issue.
Doesn't work:

static  navigatorStyle = {
    navBarHidden: true
  }

Works:

  componentWillMount() {
    this.props.navigator.setStyle({
      navBarHidden: true
    })
  }
Was this page helpful?
0 / 5 - 0 ratings