diff --git a/index.js b/index.js index af94d866..a776e668 100644 --- a/index.js +++ b/index.js @@ -43,6 +43,7 @@ const ScrollableTabView = createReactClass({ scrollWithoutAnimation: PropTypes.bool, locked: PropTypes.bool, prerenderingSiblingsNumber: PropTypes.number, + collapsableBar: PropTypes.node, }, getDefaultProps() { @@ -159,6 +160,13 @@ const ScrollableTabView = createReactClass({ } }, + renderCollapsableBar() { + if (!this.props.collapsableBar) { + return null + } + return this.props.collapsableBar + }, + updateSceneKeys({ page, children = this.props.children, callback = () => {}, }) { let newKeys = this.newSceneKeys({ previousKeys: this.state.sceneKeys, currentPage: page, children, }); this.setState({currentPage: page, sceneKeys: newKeys, }, callback); @@ -386,11 +394,14 @@ const ScrollableTabView = createReactClass({ }; } - return + const ContainerView = this.props.collapsableBar ? ScrollView : View + + return + {this.renderCollapsableBar()} {this.props.tabBarPosition === 'top' && this.renderTabBar(tabBarProps)} {this.renderScrollableContent()} {(this.props.tabBarPosition === 'bottom' || overlayTabs) && this.renderTabBar(tabBarProps)} - ; + ; }, });