index.js
1.62 KB
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
/**
* Created by Cassie on 2018/03/06
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
TouchableOpacity,
Image,
NativeModules,
ActivityIndicator
} from 'react-native';
import { StackNavigator, TabNavigator } from 'react-navigation';
import {getHeaderHeight,getHeaderPadding,getFooterBottom} from "./utils/utils";
import Home from './pages/home';
import Detail from './pages/components/detail';
import PlateList from './pages/components/plateList';
const Navigator = StackNavigator(
{
Home:{screen:Home},
Detail:{screen:Detail},
PlateList:{screen:PlateList},
},
{
navigationOptions:({navigation}) => ({
headerStyle:{
elevation:0, // 去掉阴影
paddingTop:getHeaderPadding(),
height:getHeaderHeight(),
backgroundColor:'#1c1c20',
},
headerTitleStyle:{
alignSelf:'center',
alignItems:'center',
justifyContent:'center',
flexDirection:'column',
color:'#fff',
fontSize:18,
fontWeight:'bold',
},
}),
},
);
class App extends Component{
constructor(props){
super(props);
this.state = {};
}
async componentWillMount(){}
render() {
return (
<View style={styles.root}>
<Navigator />
</View>
);
}
}
const styles = StyleSheet.create({
root:{
flex:1,
marginBottom:getFooterBottom(),
}
});
export default App;