forked from tjhickey724/cs153aFall21
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlexDemo2.js
56 lines (43 loc) · 1.34 KB
/
FlexDemo2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
// const App = () => {...}
export default function App() {
return (
<View style={styles.container}>
<View style={{flex:1, flexDirection:'column',
alignItems:'center',justifyContent:'space-around',backgroundColor:'yellow',}}>
<Text style={{fontSize:64}}>
Flex Demo 2
</Text>
<Text style={{fontSize:64}}>
Second text object
</Text>
</View>
<View style={{flex:8, flexDirection:'column'}}>
<View style={{flex:1, backgroundColor:'red'}}>
<Text style={{fontSize:32, }}> Left</Text>
</View>
<View style={{flex:9, backgroundColor:'aqua'}}>
<Text style={{fontSize:32, }}>
<Text style={{fontSize:64}}> Right.</Text>
The header, footer, and sidebar all take 10% of the screen space.
</Text>
</View>
<View style={{flex:1, alignItems:'center',backgroundColor:'mauve',}}>
<Text style={{fontSize:64}}>
Footer
</Text>
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'stretch',
justifyContent: 'stretch',
flexDirection:'row',
},
});