Skip to content

Instantly share code, notes, and snippets.

@tomleejumah
Created March 14, 2025 07:10
Show Gist options
  • Save tomleejumah/46ee8175c57820616dd390f346df7636 to your computer and use it in GitHub Desktop.
Save tomleejumah/46ee8175c57820616dd390f346df7636 to your computer and use it in GitHub Desktop.
Hiding system navigation bar in react native
import React, { useEffect } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import * as NavigationBar from 'expo-navigation-bar';
const App = () => {
useEffect(() => {
// Hide the navigation bar
NavigationBar.setVisibilityAsync('hidden');
// Set the behavior to 'overlay-swipe'
NavigationBar.setBehaviorAsync('overlay-swipe');
}, []);
return (
<View style={styles.container}>
<Text style={styles.text}>Hello, World!</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff',
},
text: {
fontSize: 18,
},
});
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment