-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ios.js
executable file
·77 lines (59 loc) · 1.5 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
'use strict';
let React = require('react-native');
let {
View, Text,
TabBarIOS,
NavigatorIOS
} = React;
let InvestView = require('./pages/invest/index');
let WalletView = require('./pages/wallet/index');
class Qianlonglaile extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedTab: 'invest'
};
}
render() {
return (
<TabBarIOS tintColor="#ff6160" barTintColor="#f0f0f0">
<TabBarIOS.Item
title="投资"
icon={require('image!licai-b')}
selectedIcon={require('image!licai-a')}
selected={this.state.selectedTab === 'invest'}
onPress={() => this.setState({selectedTab: 'invest'})} >
{createNavigator({route: {
title: '钱隆来了',
component: InvestView
}})}
</TabBarIOS.Item>
<TabBarIOS.Item
title="钱包"
icon={require('image!wallet-b')}
selectedIcon={require('image!wallet-a')}
selected={this.state.selectedTab === 'wallet'}
onPress={() => this.setState({selectedTab: 'wallet'})} >
{createNavigator({route: {
title: '我的钱包',
component: WalletView
}})}
</TabBarIOS.Item>
</TabBarIOS>
);
}
}
function createNavigator(s) {
return (
<NavigatorIOS
style={{flex:1}}
titleTextColor="#ff6160"
barTintColor="#fff"
tintColor="#ff6160"
translucent={true}
itemWrapperStyle={{backgroundColor:'#f5f5f5'}}
initialRoute={s.route}
/>
);
}
React.AppRegistry.registerComponent('qianlonglaile', () => Qianlonglaile);