A
A
Arkady Baganin2019-08-29 10:28:38
React Native
Arkady Baganin, 2019-08-29 10:28:38

How to remove the status bar?

Good day!
I have a question: how to remove the status bar on all screenshots?
Here is the current navigation code where I tried to hide the navigation:

import React from "react"
import { StatusBar } from 'react-native'
import { createDrawerNavigator, createStackNavigator, createAppContainer } from "react-navigation"
import HomeScreen from './HomeScreen'
import DetailsScreen from './DetailsScreen'
import CategoryesScreen from './CategoryesScreen'

const HomeDetails = createStackNavigator(
  {
    Home: {
      screen: HomeScreen,
      navigationOptions: {
        hideStatusBar: true
      }
    },
    Details: {
      screen: DetailsScreen,
      navigationOptions: {
        hideStatusBar: true
      }
    }
  },
  {
    initialRouteName: "Home"
  }
);

const DrawerNavigator = createDrawerNavigator(
  {
    Home: {
      screen: HomeDetails,
      navigationOptions: {
        hideStatusBar: true
      }
    },
    Categoryes: {
      screen: CategoryesScreen,
      navigationOptions: {
        hideStatusBar: true
      }
    }
  },
  {
    hideStatusBar: true,
    drawerBackgroundColor: 'rgba(255,255,255,.9)',
    overlayColor: '#6b52ae',
    contentOptions: {
      activeTintColor: '#fff',
      activeBackgroundColor: '#6b52ae',
    },
  }
);

export default createAppContainer(DrawerNavigator);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2019-08-29
@ark_yt

try this, and also specify the version of the navigator

const HomeDetails = createStackNavigator(
  {
    Home: {
      screen: HomeScreen,
      navigationOptions: {
        hideStatusBar: true,
header: null,
      }
    },
    Details: {
      screen: DetailsScreen,
      navigationOptions: {
        hideStatusBar: true,
header: null,
      }
    }
  },
  {
    initialRouteName: "Home"
  }
);

const DrawerNavigator = createDrawerNavigator(
  {
    Home: {
      screen: HomeDetails,
      navigationOptions: {
        hideStatusBar: true,
header: null,
      }
    },
    Categoryes: {
      screen: CategoryesScreen,
      navigationOptions: {
        hideStatusBar: true,
header: null,
      }
    }
  },
  {
    hideStatusBar: true,
    drawerBackgroundColor: 'rgba(255,255,255,.9)',
    overlayColor: '#6b52ae',
    contentOptions: {
      activeTintColor: '#fff',
      activeBackgroundColor: '#6b52ae',
    },
  }
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question