Giter Club home page Giter Club logo

ptomasroos / react-native-scrollable-tab-view Goto Github PK

View Code? Open in Web Editor NEW
6.9K 140.0 2.3K 7.48 MB

Tabbed navigation that you can swipe between, each tab can have its own ScrollView and maintain its own scroll position between swipes. Pleasantly animated. Customizable tab bar

Home Page: https://www.npmjs.com/package/react-native-scrollable-tab-view

JavaScript 82.99% Java 3.17% Objective-C 9.95% Starlark 3.89%
react-native tabs swipe animated

react-native-scrollable-tab-view's Introduction

react-native-scrollable-tab-view

npm version

This is probably my favorite navigation pattern on Android, I wish it were more common on iOS! This is a very simple JavaScript-only implementation of it for React Native. For more information about how the animations behind this work, check out the Rebound section of the React Native Animation Guide

Add it to your project

  1. Run npm install react-native-scrollable-tab-view --save
  2. var ScrollableTabView = require('react-native-scrollable-tab-view');

Demo

Run this example

Basic usage

var ScrollableTabView = require('react-native-scrollable-tab-view');

var App = React.createClass({
  render() {
    return (
      <ScrollableTabView>
        <ReactPage tabLabel="React" />
        <FlowPage tabLabel="Flow" />
        <JestPage tabLabel="Jest" />
      </ScrollableTabView>
    );
  }
});

Injecting a custom tab bar

Suppose we had a custom tab bar called CustomTabBar, we would inject it into our ScrollableTabView like this:

var ScrollableTabView = require('react-native-scrollable-tab-view');
var CustomTabBar = require('./CustomTabBar');

var App = React.createClass({
  render() {
    return (
      <ScrollableTabView renderTabBar={() => <CustomTabBar someProp={'here'} />}>
        <ReactPage tabLabel="React" />
        <FlowPage tabLabel="Flow" />
        <JestPage tabLabel="Jest" />
      </ScrollableTabView>
    );
  }
});

To start you can just copy DefaultTabBar.

Examples

SimpleExample.

ScrollableTabsExample.

OverlayExample.

FacebookExample.

Props

  • renderTabBar (Function:ReactComponent) - accept 1 argument props and should return a component to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props, and should implement setAnimationValue to be able to animate itself along with the tab content. You can manually pass the props to the TabBar component.
  • tabBarPosition (String) Defaults to "top".
    • "bottom" to position the tab bar below content.
    • "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom tab bars must consume a style prop on their outer element to support this feature: style={this.props.style}.
  • onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the tab that is selected
  • onScroll (Function) - function to call when the pages are sliding, should accept 1 argument which is an Float number representing the page position in the slide frame.
  • locked (Bool) - disables horizontal dragging to scroll between tabs, default is false.
  • initialPage (Integer) - the index of the initially selected tab, defaults to 0 === first tab.
  • page (Integer) - set selected tab(can be buggy see #126
  • children (ReactComponents) - each top-level child component should have a tabLabel prop that can be used by the tab bar component to render out the labels. The default tab bar expects it to be a string, but you can use anything you want if you make a custom tab bar.
  • tabBarUnderlineStyle (View.propTypes.style) - style of the default tab bar's underline.
  • tabBarBackgroundColor (String) - color of the default tab bar's background, defaults to white
  • tabBarActiveTextColor (String) - color of the default tab bar's text when active, defaults to navy
  • tabBarInactiveTextColor (String) - color of the default tab bar's text when inactive, defaults to black
  • tabBarTextStyle (Object) - Additional styles to the tab bar's text. Example: {fontFamily: 'Roboto', fontSize: 15}
  • style (View.propTypes.style)
  • contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. Note that overriding defaults set by the library may break functionality; see the source for details.
  • scrollWithoutAnimation (Bool) - on tab press change tab without animation.
  • prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all the siblings, default to 0 === render current page.

Contribution

Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first. Before submiting PR please run eslint . Also all eslint fixes are welcome.

Please attach video or gif to PR's and issues it is super helpful.

How to make video

How to make gif from video


MIT Licensed

react-native-scrollable-tab-view's People

Contributors

anyx avatar apolkingg8 avatar brentvatne avatar brunobar79 avatar camelmasa avatar cancan101 avatar chaitanya-bhagavan avatar danh-fissara avatar ethul avatar ghuh avatar irfaan avatar janicduplessis avatar kilihorse avatar litch avatar lwansbrough avatar mikemonteith avatar nihgwu avatar nimzco avatar ptomasroos avatar richard-cao avatar rkostrab avatar rpylipow avatar samuelkraft avatar shidhincr avatar shystruk avatar silentcloud avatar skv-headless avatar thoblr avatar ultragtx avatar vonovak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-scrollable-tab-view's Issues

Appears broken in RN 0.12 (RE: precomputeStyle)

I'm using a CustomTabBar but it appears properties of objects passed to the precomputeStyle function all return undefined when I upgraded to RN 0.12. Passing same object directly to setNativeProps seems to work but then the tabs do not change when tapped.

How might I attach an onPress to goToPage(x)?

I am trying to use a onPress from within a tab to switch tabs. Do you happen to know how I might access goToPage() in ScrollableTabView from within a tab? Is that the right function?

Thank you in advance!

Cannot render custom tab

'Warning: React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components).'

and it's blank, even when using given example. Running on 0.8.

Code:
<ScrollableTabView renderTabBar={() => <VenueTab />}>...</ScrollableTabView />

when change to next scence use onChange method , the process is slow

as the title ,

we can not use onChange Method to process huge logic , for example fetch data,

then when we add a method called afterChange,and put it after Animated action

here are my code

       'use strict';

      var React = require('react-native');
      var {
        Dimensions,
        Text,
        View,
        TouchableOpacity,
        PanResponder,
        Animated,
      } = React;

      var DefaultTabBar = require('./DefaultTabBar');
      var deviceWidth = Dimensions.get('window').width;

      var TimerMixin = require('react-timer-mixin');
      var ScrollableTabView = React.createClass({
        getDefaultProps() {
          return {
            edgeHitWidth: 30,
          }
        },

        mixins: [TimerMixin],
        getInitialState() {
          return { currentPage: 0, scrollValue: new Animated.Value(0) };
        },

        componentWillMount() {
          var release = (e, gestureState) => {
            var relativeGestureDistance = gestureState.dx / deviceWidth,
                lastPageIndex = this.props.children.length - 1,
                vx = gestureState.vx,
                newPage = this.state.currentPage;

            if (relativeGestureDistance < -0.5 || (relativeGestureDistance < 0 && vx <= 0.5)) {
              newPage = newPage + 1;
            } else if (relativeGestureDistance > 0.5 || (relativeGestureDistance > 0 && vx >= 0.5)) {
              newPage = newPage - 1;
            }

            this.props.hasTouch && this.props.hasTouch(false);
            this.goToPage(Math.max(0, Math.min(newPage, this.props.children.length - 1)));
          }

          this._panResponder = PanResponder.create({
            // Claim responder if it's a horizontal pan
            onMoveShouldSetPanResponder: (e, gestureState) => {
              if (Math.abs(gestureState.dx) > Math.abs(gestureState.dy)) {
                if ((gestureState.moveX <= this.props.edgeHitWidth ||
                    gestureState.moveX >= deviceWidth - this.props.edgeHitWidth) &&
                      this.props.locked !== true) {
                  this.props.hasTouch && this.props.hasTouch(true);
                  return true;
                }
              }
            },

            // Touch is released, scroll to the one that you're closest to
            onPanResponderRelease: release,
            onPanResponderTerminate: release,

            // Dragging, move the view with the touch
            onPanResponderMove: (e, gestureState) => {
              var dx = gestureState.dx;
              var lastPageIndex = this.props.children.length - 1;

              // This is awkward because when we are scrolling we are offsetting the underlying view
              // to the left (-x)
              var offsetX = dx - (this.state.currentPage * deviceWidth);
              this.state.scrollValue.setValue(-1 * offsetX / deviceWidth);
            },
          });
        },

        goToPage(pageNumber) {
          this.props.onChangeTab && this.props.onChangeTab({
            i: pageNumber, ref: this.props.children[pageNumber]
          });

          this.setState({
            currentPage: pageNumber
          });

          Animated.spring(this.state.scrollValue, {toValue: pageNumber, friction: 10, tension: 50}).start();

          if (this.props.afterChanged) {
              this.setTimeout(()=> {
                  this.props.afterChanged({
                      i: pageNumber, ref: this.props.children[pageNumber]
                  })
              },200);   
          }
        },

        renderTabBar(props) {
          if (this.props.renderTabBar === false) {
            return null;
          } else if (this.props.renderTabBar) {
            return React.cloneElement(this.props.renderTabBar(), props);
          } else {
            return <DefaultTabBar {...props} />;
          }
        },

        render() {
          var sceneContainerStyle = {
            width: deviceWidth * this.props.children.length,
            flex: 1,
            flexDirection: 'row'
          };

          var translateX = this.state.scrollValue.interpolate({
            inputRange: [0, 1], outputRange: [0, -deviceWidth]
          });

          return (
            <View style={{flex: 1}}>
              {this.renderTabBar({goToPage: this.goToPage,
                                  tabs: this.props.children.map((child) => child.props.tabLabel),
                                  activeTab: this.state.currentPage,
                                  scrollValue: this.state.scrollValue})}

              <Animated.View style={[sceneContainerStyle, {transform: [{translateX}]}]}
                {...this._panResponder.panHandlers}>
                {this.props.children}
              </Animated.View>
            </View>
          );
        }
      });

      module.exports = ScrollableTabView;

Can the default bar be styled ?

Just want to customize the padding, backgroundColor and border. Just putting and styling tab and tabs doesn't seems to work. Or it can be only achieved through customBar ?

Get active tab from ref?

Hey mate, first off, this is a beautiful module, well done!
I have some prev/next buttons that I want to control the active tab.

I put the following function on the ScrollableTabView
onChangeTab={(obj) => {this.setState({ day: obj.i })}}
then in my prev button callback, I update the view
this.refs.dayScroller.goToPage(this.state.day - 1)

This causes the horizontal swipe to be a little laggy. If I take out the onChangeTab callback, smooth again.

I am using a version of the CustomTabBar from the main example. Is there some way I can retrieve the activeTab from the dayScroller or tabBar refs?
This way, in my prev button callback, I would be able to update the view with
this.refs.dayScroller.goToPage(this.refs.dayScroller.activeTab - 1)

Using with react-native-router is slow

Hi anyone using react-native-router?

I tried to go to different route from the tabbed view and noticed that the animation is quite laggy. Anyone else facing this too?

Spring props not working

The props for spring tension, friction and clamp are being ignored.
In the goToPage method friction and tension are passed hard coded to Animated.spring

Also I think you are not using rebound anymore, instead Animated.spring which only supports friction and tension if I am not mistaken. This also means rebound could be removed as a dependency and the clampSpring prop should be removed from the Readme.

If you want I can submit a PR - just let me know if I am talking BS above ;-)

[Android] [BUG] Click event wrong tab.

I am using scrollable-tab-view with 3 children. Each child is a ListView

  <ScrollableTabView edgeHitWidth="200">

      <View tabLabel="TabOne" style={styles.container}>
        <TabOneListView />
      </View>
      <View tabLabel="TabTwo" style={styles.container}>
        <TabTwoListView />
      </View>
      <View tabLabel="TabThree" style={styles.container}>
        <TabTwoListView />
      </View>

  </ScrollableTabView>

On TabOne, I click on my list item, the click event is handled, it opens a new page, it's all ok.
When I click on an item on TabTwo, it HANDLES CLICK EVENTS FROM TAB ONE ...
I can scroll properly in TabTwo, but when I click an item, it's as if it is clicking on TabOne.

Please, can anyone try replicate this issue?

There is no problem with iOS.

[Android 5.0] Trying to call navigator.push but the screen freezes for 1 second.

I can replicate this on any Android 5.0 device. No problem with iOS or Android 4.4.

I have my Inside a Navigator. I am passing the navigator to one the tabs with <Tab rootNavigator={rootNavigator}> ... </Tab>. Then I try to call rootNavigator.push from TabOne, but there is a 1 second delay before the view starts to change. This is not a onPress problem.

Inside TabOne.js

<TouchableOpacity onPress={this.openArticleView}>
    <Text> Open Article View </Text>
</TouchableOpacity>
...
openArticleView: function(){
    this.props.rootNavigator.push({
      id: 'ArticleView',
      name: 'name',
    });
}

The screen freezes for 1 second before navigator.push starts to take effect.

[Request] Is there a chance to set the component Width?

Hi.
First of all, an awesome work.

I was wondering if you have considered using a specific width set in the component instead of using the deviceWidth?
This way the component could be used in some places that not respect the full device width

Regards

FacebookTabBar example errors

Hey first of all great repo!

I am facing an issue integrating the FacebookTabBar example. I get the error "icon.setNativeProps is not a function " in the function

setAnimationValue(value) {
var currentPage = this.props.activeTab;

this.unselectedTabIcons.forEach((icon, i) => {
  if (value - i >= 0 && value - i <= 1) {
    icon.setNativeProps({opacity: value - i});
  }
  if (i - value >= 0 &&  i - value <= 1) {
    icon.setNativeProps({opacity: i - value});
  }
});

},

Also, if I do a console.log(icon), it says icon is not defined
I had no problem integrating the CustomTabBar code. Thanks again!

Landscape mode

In landscape mode has children still the same width and tab at left side is partially displayed too.

screen shot 2015-06-25 at 15 10 04

Issue with Scrollable when included with react-native-side-menu.

I'm experiencing this issue...
I'm also using CustomTabBar as provided by you in the README.md. When someone goes to a tab it doesn't hide the other tabs, do I have to change anything in the CustomTabBar Code ?

var CustomTabBar = React.createClass({
  propTypes: {
    goToPage: React.PropTypes.func,
    activeTab: React.PropTypes.number,
    tabs: React.PropTypes.array
  },

  renderTabOption(name, page) {
    var isTabActive = this.props.activeTab === page;

    return (
      <TouchableOpacity key={name} onPress={() => this.props.goToPage(page)}>
        <View style={[styles.tab]}>
          <Text style={{color: isTabActive ? 'green' : 'grey', fontWeight: isTabActive ? 'bold' : 'normal'}}>{name}</Text>
        </View>
      </TouchableOpacity>
    );
  },

  setAnimationValue(value) {
    this.refs[TAB_UNDERLINE_REF].setNativeProps(precomputeStyle({
      left: (deviceWidth * value) / this.props.tabs.length
    }));
  },

  render() {
    var numberOfTabs = this.props.tabs.length;
    var tabUnderlineStyle = {
      position: 'absolute',
      width: deviceWidth / numberOfTabs,
      height: 4,
      backgroundColor: 'green',
      bottom: 0,
    };

    return (
      <View style={styles.tabs}>
        {this.props.tabs.map((tab, i) => this.renderTabOption(tab, i))}
        <View style={tabUnderlineStyle} ref={TAB_UNDERLINE_REF} />
      </View>
    );
  },
});

react-native: 0.7.1
react-native-scrollable-tab-view: 0.1.7 ( because only this version works with react-native 0.7.1 )

screen shot 2015-07-24 at 11 40 03 am

Adjust speed at which animation occurs

Hi! I've been playing around with spring tension and friction, but how do I adjust the overall speed at which the transition takes place?

Thanks again for all of your work on this plugin!

Any way to listen for when the current page changes?

Hello, thank you for this module I really like it.

I want to load the data of a page only when it becomes active.
I'm a little noob with react still so I don't know if this is easy or not to implement, but is there a way to know when a page changes?

Thank you.

Tab bar places itself under the navigationbar

When implementing this with a navigation bar, the tab bar get's rendering behind the navigation bar.
screen shot 2015-07-03 at 12 30 03

render: function() {
    return (
      <NavigatorIOS
        style={styles.container}
        initialRoute={{
          title: 'Mine Rabatter',
          component: Main,
        }}
      />
    );
  }

Error when only single tab

There is a example in below

<ScrollableTabView edgeHitWidth={deviceWidth / 2}>
  <View tabLabel="Only me">...</View>
</ScrollableTabView>

2015-10-27 11 27 22

Dependencies issues since 0.9 release

Hi,

Since the 0.9, I got this when running the App:

Unable to resolve module precomputeStyle from /App/node_modules/react-native-scrollable-tab-view/index.js
Unable to resolve module precomputeStyle from /App/node_modules/react-native-scrollable-tab-view/DefaultTabBar.js

Many plugins make similar errors.
The project still compiles though.

undefined is not an object (evaluating 'validAttributes[key]')

Hey there, i am trying to use the basic implementations in my Android App, but i am keep getting these errors...

screen shot 2015-10-20 at 11 17 09

screen shot 2015-10-20 at 11 12 09

npm manager:

Unable to resolve module precomputeStyle from ProjectPath.../node_modules/react-native-scrollable-tab-view/index.js
Unable to resolve module precomputeStyle from ProjectPath.../node_modules/react-native-scrollable-tab-view/DefaultTabBar.js

[Packager] Unable to resolve module precomputeStyle

I found this issue, I'm running react-native 0.8.0. My app runs in development and the packager throws that error. When I set the app for production mode (minifying the js and running it inside the app) it crashes.

Sticky ListView Section Header Slides Under Facebook Tab Bar

I've been having hard time trying to get ListView's section header to stick to the bottom of Facebook TabBar, its default is to stick to the top of the screen. When I scroll, the section header slides under the tab-bar. Any thoughts on this? Anything I should change in FacebookTabBar.js to make this work?

Without tab bar at the top.
nobar

With tab bar at the top. (Strange how GIF version doesn't show the full video properly, just imagine that the list is scrolled a lot and the section header slides under the tab bar).
withbar

Touchable elements only work in the default page(first child)

TextInput in the Search component does not work (second child)..It does not trigger any input or keyboard.. (ANDROID)
if I swap the children ..Search will work, but Home won't.
The first child component always work, so for this case the Home component works fine.

example :

     return (
     <ScrollableTabView >
         <Home key="Home"   />
         <Search key="Search"   />
     </ScrollableTabView>
     )

Search - render

    var info = _.map(this.state.filtered, (data) => {
        return (
         <TouchableHighlight  underlayColor='#dddddd' onPress={this._viewDetails.bind(this, lead)}>
             <View style={styles.row}>
                 <View>
                     <View>
                         <Text style={styles.details} >{data.firstname +  ' ' + data.lastname}</Text>
                         <Text style={styles.company}>{data.company}</Text>
                     </View>
                 </View>
                 <Icon name='angle-right' size={20} style={styles.image} />
             </View>
         </TouchableHighlight>
        );


    return (
     <ScrollView>
         <TextInput style={styles.searchInput}
                    onChangeText={this._search.bind(this)} placeholder='search'/>
         <View style={styles.container}>
             {info}
         </View>
     </ScrollView>
    );
}

DOES ANYONE KNOW IF THERE IS SOMETHING MISSING HERE ?

Upgrading to 0.9.0 breaks the CustomTabBar

For some reason, the styles on the CustomTabBar break when upgrading form 0.8.0 to 0.9.0. It has to do with the flex not taking up equal space. I've just double checked, because I know it sounds weird, but the only thing changed is the version of RN.

See screenshots:

0.9.0
screen shot 2015-08-18 at 11 27 20 am

0.8.0, with equal spacing
screen shot 2015-08-18 at 11 24 50 am

Any idea?

Is it necessary to make a chance to set sceneContainerStyle?

👍 Thanks for awesome job,I use this component for my first-try on RN:

a-rntesterhome-demo

https://github.com/qddegtya/A-ReactNative-TesterHome

Here's the confusing problem:

There are three ListView Children mounted on ScrollTabView with a customRenderTabBar.
By Default,the customRenderTabBar will on top of those ListView.
So, when i scroll to Bottom of the ListView, i find out that the ListView has been 'truncated'.
After thinking about this condition, i tried this:

var sceneContainerStyle = {
      width: deviceWidth * this.props.children.length,
      flex: 1,
      flexDirection: 'row'
      paddingBottom: 113 /*I add the paddingBottom style.*/
    };

Then I fix the problem.

Here's my source code:

'use strict';

var React = require('react-native');
var TopicCard = require('./a-TopicCard');
var apilist = require('../apilist');
var ScrollableTabView = require('react-native-scrollable-tab-view');
var TopicTabBar = require('./a-TopicTabBar');

var {
  StyleSheet,
  Text,
  View,
  TabBarIOS,
  NavigatorIOS,
  ScrollView
} = React;

var TopicPage = React.createClass({

  _renderSlidesContent(slides) {
     return slides.map((obj) => {
       return (
         <View tabLabel={obj.tabLable} style={{ flex: 1 }}>
         {/* This is a ListView component */}
          <TopicCard
            resourceApi={obj.api}
            currentReqName={obj.apiName}
          />
        </View>
       )
     });
  },

  render: function() {
    return (
      <ScrollableTabView
        renderTabBar={() => <TopicTabBar />}
        sceneContainerStyle={{ paddingBottom: 113 }}
       >

       {this._renderSlidesContent(this.props.needSlideContents)}
      </ScrollableTabView>
    );
  },
});

module.exports = TopicPage;

So, I'm thinking: Is it necessary to make a chance to set sceneContainerStyle?
Or........Is there any better solution to fix my problem?

<View style={Object.assign(sceneContainerStyle, this.props.sceneContainerStyle)} {...this._panResponder.panHandlers}
              ref={view => { this.scrollView = view; }}>
          {this.props.children}
</View>

Text going out of section frame

Hi,

I didn't see anybody reporting this issue so here it is: I tried the basic usage example that works perfectly fine... Except if the inside text is too long to hold in a section.
Here's what it gives:
image

When the code is simply:

render() {
     return (
        <View style={styles.container2}>
            <ScrollableTabView>
                <Homepage tabLabel="React" />
                <Profile tabLabel="Flow" />
                <Settings tabLabel="Jest" />
            </ScrollableTabView>
        </View>
    );
}

With the Homepage component being defined as follows:

class Homepage extends Component {
    render() {
        return (
            <View style={styles.container}>
                <Text style={styles.welcome}>
                    Welcome! This is the Homepage. And some more ligns just to check everything's fine.
                </Text>
            </View>
        );
    }
}

It used to automatically wrap in the Navigator. For info here's styles.container:

container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
},

0.13 new bugs

In RN 0.13, facebook removed precomputeStyle,you should remove precomputeStyle and replace all codes
like

this.scrollView.setNativeProps(precomputeStyle{
          transform: [{translateX: -1 * offsetX}],
        });

by

this.scrollView.setNativeProps({style:{
          transform: [{translateX: -1 * offsetX}],
        }});

code EPEERINVALID on Install

Just started to get this when i run into the examples directory examples/FacebookTabsExample and trying to install the required version of the module.

FacebookTabsExample genie$ npm install
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preinstall [email protected]
npm info package.json [email protected] No license field.
npm info package.json [email protected] No license field.
npm info build /Users/genie/myfile/xcode/react-native-scrollable-tab-view/examples/FacebookTabsExample
npm info linkStuff [email protected]
npm info build /Users/genie/myfile/xcode/react-native-scrollable-tab-view/examples/FacebookTabsExample/node_modules/react-native-icons
npm info preinstall [email protected]
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info prepublish [email protected]
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react-native does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react-native@>=0.8.0 || 0.8.0-rc
npm ERR! peerinvalid Peer [email protected] wants react-native@^0.5.0

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/genie/myfile/xcode/react-native-scrollable-tab-view/examples/FacebookTabsExample/npm-debug.log

This is the content of package.json

{
  "name": "FacebookTabsExample",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node_modules/react-native/packager/packager.sh"
  },
  "dependencies": {
    "react-native": "^0.5.0",
    "react-native-icons": "0.0.9",
    "react-native-scrollable-tab-view": "^0.1.4"
  }
}

Thanks for all the awesome libraries!

FacebookTabBar Opacity Calculation

In FacebookTabBar.js, it looks like setAnimationValue is not calculating the icon opacity correctly.

Initial app launch.

screen shot 2015-06-21 at 4 09 58 pm

After selecting the 5th icon.

screen shot 2015-06-21 at 4 09 42 pm

Tab get on top of Drawer

I am using this plugin https://github.com/rt2zz/react-native-drawer . I was happy with both of the plugin only till I find that how scroll-tab work by hiding it self on the left.

So the problem happen when I open drawer I see that my hidden scrolled tab are over the drawer.

Is there any suggestion how I can force this scroll-tab to be under or force the drawer to be always on top ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.