-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
84 lines (72 loc) · 1.65 KB
/
App.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
//import library
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
//creat a component
const Header = () =>{
const {container, box, headerbox, circle, circlebox} = styles;
return(
<View style={container}>
<Text style={[headerbox, {backgroundColor: 'black'}]}>FAB Example</Text>
<Text style={[box, {backgroundColor: '#77DDFF', flex: 3}]}></Text>
<Text style={[box, {backgroundColor: '#FFBB00', flex: 5 }]}></Text>
<View style={circle}>
<Text style={[circlebox, {alignItems: 'flex-end'}]}>+</Text>
</View>
</View>
);
};
//export
export default Header;
//styling component
const styles = StyleSheet.create({
container: {
backgroundColor: 'gray',
flex: 1,
},
headerbox: {
backgroundColor: 'black',
color: 'white',
padding: 20,
fontSize: 18,
textAlign: 'center',
justifyContent: 'center',
fontWeight: 'bold',
height: 70,
width: 375,
},
box: {
flex: 1,
backgroundColor: 'yellow',
color: 'white',
padding: 20,
fontSize: 18,
textAlign: 'center',
},
circle: {
//position
position: 'absolute',
top: 250,
right: 20,
//style
backgroundColor: '#ff5722',
borderColor: '#ff5722',
width: 80,
height: 80,
borderRadius: 40,
alignItems: 'center',
justifyContent: 'center',
//shadow -----> android 效果好像出不來
shadowColor: '#000000',
shadowOpacity: 0.8,
shadowRadius: 2,
shadowOffset: {
height: 2,
width: 0,
}
},
circlebox: {
color: 'white',
fontSize: 30,
fontWeight: '100',
}
});