Add static safe area insets
This commit is contained in:
10
example/src/Constants.ts
Normal file
10
example/src/Constants.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import StaticSafeAreaInsets from "react-native-static-safe-area-insets";
|
||||
|
||||
export const CONTENT_SPACING = 15;
|
||||
|
||||
export const SAFE_AREA_PADDING = {
|
||||
paddingLeft: StaticSafeAreaInsets.safeAreaInsetsLeft + CONTENT_SPACING,
|
||||
paddingTop: StaticSafeAreaInsets.safeAreaInsetsTop + CONTENT_SPACING,
|
||||
paddingRight: StaticSafeAreaInsets.safeAreaInsetsRight + CONTENT_SPACING,
|
||||
paddingBottom: StaticSafeAreaInsets.safeAreaInsetsBottom + CONTENT_SPACING
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { StyleSheet, View, Text, Image } from 'react-native';
|
||||
import { Camera, CameraPermissionStatus } from 'react-native-vision-camera';
|
||||
import { SAFE_AREA_PADDING } from './Constants';
|
||||
|
||||
export default function Splash() {
|
||||
const [
|
||||
@@ -64,6 +65,7 @@ const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: 'white',
|
||||
...SAFE_AREA_PADDING
|
||||
},
|
||||
box: {
|
||||
width: 60,
|
||||
|
||||
Reference in New Issue
Block a user