-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppBasic.js
157 lines (150 loc) · 4.47 KB
/
AppBasic.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
const App: () => React$Node = () => {
const handlePess = () => console.log("Text press");
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView style={styles.body} >
<View style={styles.container}>
<View style={[styles.sessionFlex1, styles.displayFlexEnd]}>
<View style={[styles.subSesson, styles.subSesson1]}>
<Text></Text>
<Text></Text>
<Text></Text>
</View>
<View style={[styles.subSesson, styles.subSesson2]}></View>
<View style={[styles.subSesson, styles.subSesson3]}></View>
</View>
<View style={[styles.sessionFlex1, styles.displayRowSpace]}>
<View style={[styles.subSesson, styles.subSesson1]}>
<Text>My</Text>
<Text>My Lâm</Text>
<Text>Lâm Hải My</Text>
</View>
<View style={[styles.subSesson, styles.subSesson2]}></View>
<View style={[styles.subSesson, styles.subSesson3]}></View>
</View>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.sesson2}>
<View style={styles.containerCenter}>
<Text style={styles.title}>This session can scroll</Text>
</View>
<View style={styles.displayRowBetween}>
<View>
<View style={[styles.subSesson, styles.subSesson1]}></View>
<View style={[styles.subSesson, styles.subSesson2]}></View>
<View style={[styles.subSesson, styles.subSesson3]}></View>
</View>
<View>
<View style={[styles.subSesson, styles.subSesson1]}>
<Text>My</Text>
<Text>My Lâm</Text>
<Text>Lâm Hải My</Text>
</View>
<View style={[styles.subSesson, styles.subSesson2]}></View>
<View style={[styles.subSesson, styles.subSesson3]}></View>
</View>
<View>
<View style={[styles.subSesson, styles.subSesson1]}></View>
<View style={[styles.subSesson, styles.subSesson2]}></View>
<View style={[styles.subSesson, styles.subSesson3]}></View>
</View>
</View>
</ScrollView>
<View style={styles.sesson3}>
<Text onPress={handlePess} numberOfLines={1}>With React Native, you style your application using JavaScript. All of the core components accept a prop named style. The style names and values usually match how CSS works on the web, except names are written using camel casing, e.g. backgroundColor rather than background-color.</Text>
<Text style={styles.title}>Can not scroll</Text>
<View>
<View style={[styles.subSesson, styles.subSesson1]}></View>
<View style={[styles.subSesson, styles.subSesson2]}></View>
<View style={[styles.subSesson, styles.subSesson3]}></View>
</View>
</View>
</View>
</SafeAreaView>
</>
);
};
const styles = StyleSheet.create({
body: {
flex: 1,
backgroundColor: "bisque",
},
container: {
flex: 1,
backgroundColor: "#fff"
},
title: {
color: "brown",
fontWeight: "bold",
fontSize: 20
},
containerCenter: {
alignItems: "center",
justifyContent: "center"
},
sessionFlex1:{
flex: 1,
backgroundColor: "aliceblue"
},
sesson2:{
flex: 1,
backgroundColor: "antiquewhite"
},
sesson3:{
flex: 1,
backgroundColor: "beige"
},
subSesson: {
width: 100,
height: 100
},
displayRow: {
flexDirection: "row"
},
displayFlexEnd: {
flexDirection: "row",
justifyContent: "flex-end"
},
displayRowSpace: {
flexDirection: "row",
justifyContent: "space-around"
},
displayRowBetween: {
flexDirection: "row",
justifyContent: "space-between"
},
subSesson1: {
backgroundColor: "tomato"
},
subSesson2: {
backgroundColor: "cadetblue"
},
subSesson3: {
backgroundColor: "darksalmon"
}
});
export default App;