Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

scrollEnabled doesn't work on tabbar? #347

Open
JulianKingman opened this issue Dec 29, 2016 · 4 comments
Open

scrollEnabled doesn't work on tabbar? #347

JulianKingman opened this issue Dec 29, 2016 · 4 comments

Comments

@JulianKingman
Copy link

the scrollEnabled prop should allow a tabbar to have scrollable tabs, but currently they just scrunch together.

I over-rode the header and it seems to work, via the renderHeader prop in <SlidingTabNavigation>

@amanthegreatone
Copy link

amanthegreatone commented Dec 29, 2016

@JulianKingman can you please share what needs to overridden and how?

@gwmccull
Copy link

There are a couple open PRs that aim to fix this. #337 and #325

@JulianKingman
Copy link
Author

@gwmccull Cool, I look forward to it!

In the meantime @amanthegreatone, this is how I did it (only showing relevant props):

import {TabBarTop} from 'react-native-tab-view';
import {SlidingTabNavigation, SlidingTabNavigationItem} from '@exponent/ex-navigation';

const renderHeader = (props) => {
    const {style} = this.props;
    return (<TabBarTop
      scrollEnabled
      renderLabel={this.renderLabel}
      {...props}
    />);
  };

const tabs = (props) =>{
  <SlidingTabNavigation renderHeader={renderHeader}>
    <SlidingTabNavigationItem>{*/things go here*/}</SlidingTabNavigationItem>
  </SlidingTabNavigation>
}

TabBarTop can take any props specified in react-native-tab-view (here: https://github.com/react-native-community/react-native-tab-view), which is what SlidingTabNavigation is based on.

@amanthegreatone
Copy link

@JulianKingman thanks for the tip!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants