/* SafeAreaView it's a react native component that allows you to ensure that
your content is visible for all ios devices screens */
import { SafeAreaView } from 'react-native'; // import it like this
<SafeAreaView> // use it later like this
// some content
</SafeAreaView>
import { StyleSheet, Platform, StatusBar } from "react-native";
export default StyleSheet.create({
AndroidSafeArea: {
flex: 1,
backgroundColor: "white",
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0
}
});
//if it won't work when exporting from 'react-native'
npm install react-native-safe-area-context
import { SafeAreaView } from 'react-native-safe-area-context ';
import { SafeAreaView } from 'react-native-safe-area-context'
import React from 'react';
import { StyleSheet, Text, SafeAreaView } from 'react-native';
const App = () => {
return (
<SafeAreaView style={styles.container}>
<Text style={styles.text}>Page content</Text>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
text: {
fontSize: 25,
fontWeight: '500',
}
});
export default App;