-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.ios.js
92 lines (84 loc) · 2.39 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import styles from './app/Styles/Main';
import MovieList from './app/Components/MovieList';
import USBox from './app/Components/USBox';
import icons from './app/Assets/Icons';
import Featured from './app/Components/Featured';
import Search from './app/Components/Search';
import User from './app/Components/User';
import {
AppRegistry,
StyleSheet,
Text,
View,
ListView,
Image,
TabBarIOS,
} from 'react-native';
class MovieTalk extends React.Component {
constructor(props){
super(props);
this.state = {
selectedTab: 'user'
}
}
render(){
return (
<TabBarIOS barTintColor="darkslateblue">
<TabBarIOS.Item
// systemIcon="featured"
icon={{uri: icons.star, scale:4.6}}
title="推荐电影"
selectedIcon={{uri:icons.star, scale:4.6}}
selected={this.state.selectedTab === 'featured'}
onPress={()=>{
this.setState({
selectedTab: 'featured'
});
}}>
<Featured />
</TabBarIOS.Item>
<TabBarIOS.Item
icon={{uri: icons.board, scale:4.6}}
title="北美票房"
selectedIcon={{uri:icons.boardActive, scale:4.6}}
selected={this.state.selectedTab === 'us_box'}
onPress={()=>{
this.setState({
selectedTab: 'us_box'
});
}}>
<USBox />
</TabBarIOS.Item>
<TabBarIOS.Item
icon={{uri: icons.search, scale:4.6}}
title="搜索"
selected={this.state.selectedTab === 'search'}
onPress={()=>{
this.setState({
selectedTab: 'search'
});
}}>
<Search />
</TabBarIOS.Item>
<TabBarIOS.Item
icon={{uri: icons.user, scale:4.6}}
title="我的"
selected={this.state.selectedTab === 'user'}
onPress={()=>{
this.setState({
selectedTab: 'user'
});
}}>
<User />
</TabBarIOS.Item>
</TabBarIOS>
);
}
}
AppRegistry.registerComponent('MovieTalk', () => MovieTalk);