forked from AlbertBrand/react-native-android-tablayout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabLayout.js
More file actions
33 lines (28 loc) · 719 Bytes
/
TabLayout.js
File metadata and controls
33 lines (28 loc) · 719 Bytes
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
import React from 'react-native';
const {
PropTypes,
requireNativeComponent,
UIManager,
View,
} = React;
class TabLayout extends React.Component {
static propTypes = {
...View.propTypes,
selectedTabIndicatorColor: PropTypes.string,
selectedTab: PropTypes.number,
onTabSelected: PropTypes.func,
};
_onTabSelected(e:Event) {
this.props.onTabSelected && this.props.onTabSelected(e);
}
render() {
return (
<AndroidTabLayout
{...this.props}
style={[{ height: 48 }, this.props.style]}
onTabSelected={this._onTabSelected.bind(this)}/>
);
}
}
var AndroidTabLayout = requireNativeComponent('TabLayout', TabLayout);
module.exports = TabLayout;