-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathindex.ios.js
101 lines (91 loc) · 2.85 KB
/
index.ios.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
TabBarIOS,
NavigatorIOS,
} = React;
var RubyChina = React.createClass({
getInitialState: function() {
return {
selectedTab: 'home'
};
},
render: function() {
return (
<TabBarIOS selectedTab={this.state.selectedTab}>
<TabBarIOS.Item accessibilityLabel={"Excellent"}
selected={this.state.selectedTab === 'home'}
title="精华"
name="home"
icon={{uri: 'icon.png', isStatic: true}}
onPress={() => {
this.setState({
selectedTab: 'home'
});
}}>
<NavigatorIOS style={Style.container}
tintColor={'#333344'}
initialRoute={{
title: '社区精华',
component: require('./App/Views/Home/Home')
}}
itemWrapperStyle={Style.navigator} />
</TabBarIOS.Item>
<TabBarIOS.Item accessibilityLabel={"Nodes"}
selected={this.state.selectedTab === 'nodes'}
title="节点分类"
name="nodes"
icon={{uri:'nodes.png'}}
onPress={() => {
this.setState({
selectedTab: 'nodes'
});
}}>
<NavigatorIOS style={Style.container}
tintColor={'#333344'}
initialRoute={{
title: '节点分类',
component: require('./App/Views/Home/Nodes')
}}
itemWrapperStyle={Style.navigator} />
</TabBarIOS.Item>
<TabBarIOS.Item accessibilityLabel={"About"}
selected={this.state.selectedTab === 'about'}
title="关于"
name="about"
icon={{uri: 'reactnative_logo.png'}}
onPress={() => {
this.setState({
selectedTab: 'about'
});
}}>
<NavigatorIOS style={Style.container}
tintColor={'#333344'}
initialRoute={{
title: 'About',
component: require('./App/Views/Home/About')
}}
itemWrapperStyle={Style.navigator} />
</TabBarIOS.Item>
</TabBarIOS>
);
}
});
var Style = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#E7EAEC'
},
navigator: {
backgroundColor: '#E7EAEC'
}
});
AppRegistry.registerComponent('RubyChina', () => RubyChina);