Created
March 14, 2025 07:10
-
-
Save tomleejumah/46ee8175c57820616dd390f346df7636 to your computer and use it in GitHub Desktop.
Hiding system navigation bar in react native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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