-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppContainer.js
61 lines (56 loc) · 1.48 KB
/
AppContainer.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
StyleSheet,
Text,
Image,
View,
TabBarIOS
} from 'react-native';
class AppContainer extends Component {
state = {
selectedTab: 'feed'
};
render() {
return (
<TabBarIOS style={styles.container}>
<TabBarIOS.Item
title="Feed"
icon={require('./img/inbox.png')}
selected={this.state.selectedTab=='feed'}
onPress={()=>this.setState({selectedTab: 'feed'})}
>
<Text style={styles.welcome}>Tab 1</Text>
</TabBarIOS.Item>
<TabBarIOS.Item
title="Search"
icon={require('./img/search.png')}
selected={this.state.selectedTab=='Search'}
onPress={()=>this.setState({selectedTab: 'Search'})}
>
<Text style={styles.welcome}>Tab 2</Text>
</TabBarIOS.Item>
</TabBarIOS>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 40,
padding: 10,
justifyContent: 'center',
alignItems: 'center',
},
welcome: {
color: 'black',
fontSize: 28,
textAlign: 'center',
marginTop: 50
}
});
export default AppContainer;