-
Notifications
You must be signed in to change notification settings - Fork 4
/
IconsOnTopTabLayout.js
57 lines (53 loc) · 1.27 KB
/
IconsOnTopTabLayout.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
import React, {
Component,
} from 'react';
import {
StyleSheet,
View
} from 'react-native';
import { Tab, TabLayout } from 'react-native-android-tablayout'
import Icon from 'react-native-vector-icons/FontAwesome';
import Labels from './Labels';
export default class IconsOnTopTabLayout extends Component {
constructor() {
super(...arguments);
this.state = {
iconUri: ''
};
}
componentDidMount() {
Icon.getImageSource('user', 24, 'red').then(source => {
this.setState({ iconUri: source.uri })
});
}
render() {
return (
<View>
<TabLayout style={styles.tabLayout}>
<Tab
name="Tab 1"
accessibilityLabel={Labels.IconsOnTop.tab1}
iconSize={24}
iconUri={this.state.iconUri}/>
<Tab
name="Tab 2"
accessibilityLabel={Labels.IconsOnTop.tab2}
iconSize={24}
iconResId="custom_icon"/>
<Tab
name="Tab 3"
accessibilityLabel={Labels.IconsOnTop.tab3}
iconSize={24}
iconPackage="android"
iconResId="emo_im_cool"/>
</TabLayout>
</View>
)
}
}
const styles = StyleSheet.create({
tabLayout: {
backgroundColor: '#ddd',
height: 72,
},
});