-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainScreen.js
116 lines (109 loc) · 3.71 KB
/
MainScreen.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
/**
* MainScreen
* meituandemo
* Created by peng on 2017/5/23 13:30.
* @WebStorm
*/
import React from 'react';
import {AppRegistry, StatusBar, View, Image} from 'react-native';
import {
StackNavigator,
TabNavigator,
TabBarBottom,
} from 'react-navigation';
import HomeScreen from './app_modules/Home/Screen/HomeScreen';
import NearbyScreen from './app_modules/Nearby/Screen/NearbyScreen';
import OrderScreen from './app_modules/Order/Screen/OrderScreen';
import MineScreen from './app_modules/Mine/Screen/MineScreen';
import WebScreen from './app_modules/Tools/WebScreen'
import GroupPurchaseScreen from './app_modules/Home/Screen/GroupPurchaseScreen'
export default class MainScreen extends React.Component {
constructor() {
super();
StatusBar.setBarStyle('light-content')
}
render() {
return (
<Navigator>
</Navigator>
);
}
}
const Tab = TabNavigator(
{
Home: {
screen: HomeScreen,
navigationOptions: ({navigation}) => ({
tabBarLabel: '首页',
tabBarIcon: ({focused, tintColor}) => (
<Image
source={focused ? require('./app_modules/Image/Tabbar/[email protected]') : require('./app_modules/Image/Tabbar/[email protected]')}
style={{tintColor: tintColor, width: 25, height: 25}}
/>
)
})
},
Neaby: {
screen: NearbyScreen,
navigationOptions: ({navigation}) => ({
tabBarLabel: '附近',
tabBarIcon: ({focused, tintColor}) => (
<Image
source={focused ? require('./app_modules/Image/Tabbar/[email protected]') : require('./app_modules/Image/Tabbar/[email protected]')}
style={{tintColor: tintColor, width: 25, height: 25}}
/>
)
})
},
Order: {
screen: OrderScreen,
navigationOptions: ({navigation}) => ({
tabBarLabel: '订单',
tabBarIcon: ({focused, tintColor}) => (
<Image
source={focused ? require('./app_modules/Image/Tabbar/[email protected]') : require('./app_modules/Image/Tabbar/[email protected]')}
style={{tintColor: tintColor, width: 25, height: 25}}
/>
)
})
},
Mine: {
screen: MineScreen,
navigationOptions: ({navigation}) => ({
tabBarLabel: '我的',
tabBarIcon: ({focused, tintColor}) => (
<Image
source={focused ? require('./app_modules/Image/Tabbar/[email protected]') : require('./app_modules/Image/Tabbar/[email protected]')}
style={{tintColor: tintColor, width: 25, height: 25}}
/>
)
})
}
},
{
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
swipeEnabled: true,
lazy: true,
animationEnabled: true,
tabBarOptions: {
activeTintColor: '#06c1ae',
inactiveTintColor: '#979797',
style:{ backgroundColor: '#ffffff'}
}
}
)
const Navigator = StackNavigator(
{
Tab: {screen: Tab},
Web: {screen: WebScreen},
Group: {screen: GroupPurchaseScreen}
},
{
navigationOptions: {
headerBackTitle: null,
headerTintColor: '#111111',
showIcon: true,
}
}
)