浏览代码

using safe area view seems safer on ios

master
Elias Sebbar 2 年前
父节点
当前提交
882ae41276
共有 3 个文件被更改,包括 9898 次插入17 次删除
  1. 3
    2
      App.js
  2. 3
    2
      components/add_depense.js
  3. 9892
    13
      package-lock.json

+ 3
- 2
App.js 查看文件

@@ -1,6 +1,7 @@
1 1
 import { StatusBar } from 'expo-status-bar';
2 2
 import React, { useEffect } from 'react';
3 3
 import { StyleSheet, Text, View, TextInput } from 'react-native';
4
+import { SafeAreaView } from 'react-native-safe-area-context';
4 5
 import AddDepense from './components/add_depense';
5 6
 import DepensesList from './components/depenses_list';
6 7
 import TitleBar from './components/title_bar';
@@ -31,7 +32,7 @@ export default function App() {
31 32
   });
32 33
 
33 34
   return (
34
-    <View style={styles.home}>
35
+    <SafeAreaView style={styles.home}>
35 36
       <View style={styles.container, {
36 37
         flexDirection: "column"
37 38
       }}>
@@ -49,7 +50,7 @@ export default function App() {
49 50
       </View>
50 51
         {/* Overlay for expenses */}
51 52
       <AddDepense fetchDepenses={() => onFetchDepenses(true)}/>
52
-    </View>
53
+    </SafeAreaView>
53 54
   );
54 55
 }
55 56
 

+ 3
- 2
components/add_depense.js 查看文件

@@ -1,12 +1,13 @@
1 1
 import React from 'react';
2 2
 import { StyleSheet, Text, View, TextInput, Button, Pressable } from 'react-native';
3
+import { SafeAreaView } from 'react-native-safe-area-context';
3 4
 import DepenseForm from './depense_edit/depense_form';
4 5
 
5 6
 
6 7
 export default function AddDepense(props){
7 8
     const [addingDepense, onAddDepense] = React.useState(false);
8 9
 
9
-    return (<View style={ add_depenses_styles.overlay }>
10
+    return (<SafeAreaView style={ add_depenses_styles.overlay }>
10 11
     <View >
11 12
         {addingDepense ? 
12 13
             <DepenseForm fetchDepenses={props.fetchDepenses} onAddDepense={onAddDepense}/>
@@ -21,7 +22,7 @@ export default function AddDepense(props){
21 22
         
22 23
         </Pressable>
23 24
     </View>
24
-    </View>
25
+    </SafeAreaView>
25 26
     );
26 27
 }
27 28
 

+ 9892
- 13
package-lock.json
文件差异内容过多而无法显示
查看文件


正在加载...
取消
保存