Giter Club home page Giter Club logo

Comments (10)

gabecoyne avatar gabecoyne commented on June 4, 2024

We are experiencing the same issues with TouchableNativeFeedback on tabs other than the first tab.

Would love to know if you figure it out. We're looking into it too.

from react-native-scrollable-tab-view.

gabecoyne avatar gabecoyne commented on June 4, 2024

We are seeing that the hit areas stick for the first component.

After you switch tabs, the first component's hit areas are still touchable.

from react-native-scrollable-tab-view.

edudel avatar edudel commented on June 4, 2024

Correct !!. the only workaround.. hacky approach that I have found so far is.. to use onChangeTab.. and change the order of the children.. so the second becomes the first component.(assuming that only the first one works) but its a double transition. there should be a better solution.

from react-native-scrollable-tab-view.

kusamakura avatar kusamakura commented on June 4, 2024

Might be related to facebook/react-native#3557 ?

from react-native-scrollable-tab-view.

syarul avatar syarul commented on June 4, 2024

I got this solve by using @devknoll PR which not being push yet, which use ScrollView rather than using current PanResponder to switch pages, the commit => 218ab69, For quick solution just copy and replace index.js inside node_modules/react-native-scrollable-tab-view, solved issue #58

from react-native-scrollable-tab-view.

edudel avatar edudel commented on June 4, 2024

Im getting a blank page when using that new index.js.. after changing the style under <ScrollView from
{{flex: 1}} to {{flexDirection: 'row'}} I see the 2 children displays fitted into one page....
I also noticed that this line
this.refs.scrollView.scrollTo(null, pageNumber * deviceWidth);
does not scroll
any thoughts ?
thanks
Im using react native 0.13.0-rc .. android nexus 6, 23 SDK

from react-native-scrollable-tab-view.

gabecoyne avatar gabecoyne commented on June 4, 2024

I've created a new version with ViewPagerAndroid:
https://gist.github.com/gabecoyne/3b9ffa89b07ac4f42dc7

from react-native-scrollable-tab-view.

syarul avatar syarul commented on June 4, 2024

I'm using 0.13 and made a modified version of FacebookTabBar.js in the sample folder

'use strict';

var React = require('react-native');
var {
  StyleSheet,
  View,
  TouchableWithoutFeedback,
  Image
} = React;

var styles = StyleSheet.create({
  tab: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    paddingBottom: 10,
  },

  tabs: {
    height: 50,
    flexDirection: 'row',
    justifyContent: 'space-around',
    paddingTop: 10,
    borderWidth: 1,
    borderTopWidth: 0,
    borderLeftWidth: 0,
    borderRightWidth: 0,
    backgroundColor: '#1d1d1d',
    borderBottomColor: 'rgba(0,0,0,0.05)',
  },
  unselect: {
    width: 30, height: 30, tintColor: '#817061', borderWidth: 0.1
  },
  select: {
    width: 30, height: 30, tintColor: '#ffb27a', borderWidth: 0.1
  }
});

var FacebookTabBar = React.createClass({

  propTypes: {
    goToPage: React.PropTypes.func,
    activeTab: React.PropTypes.number,
    tabs: React.PropTypes.array
  },

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

    var useStyle
    if(isTabActive){
      useStyle = styles.select
    } else {
      useStyle = styles.unselect
    }

    return (
      <TouchableWithoutFeedback key={name.uri} onPress={() => this.props.goToPage(page)} style={[styles.tab]}>
        <View>
          <Image
            source={name}
            style={useStyle}/>
        </View>
      </TouchableWithoutFeedback>
    );
  },
  render() {
    return (
      <View style={styles.tabs}>
        {this.props.tabs.map((tab, i) => this.renderTabOption(tab, i))}
      </View>
    );
  },
});

module.exports = FacebookTabBar;

To use this just require the module

return (
      <View style={styles.container}>
        <ScrollableTabView renderTabBar={() => <FacebookTabBar />}>
          <ScrollView tabLabel={require('image!ic_menu_main')} style={styles.tabView}>  
        // item 1
          </ScrollView>
          <ScrollView tabLabel={require('image!ic_menu_map')} style={styles.tabView}>
            // item 2
          </ScrollView>
          <ScrollView tabLabel={require('image!ic_menu_cal')} style={styles.tabView}>
            // item 3
          </ScrollView>
          <ScrollView tabLabel={require('image!ic_menu_fav')} style={styles.tabView}>
            // item 4
          </ScrollView>
          <ScrollView tabLabel={require('image!ic_menu_user')} style={styles.tabView}>
            // item 5
          </ScrollView>
        </ScrollableTabView>
      </View>
    );

from react-native-scrollable-tab-view.

edudel avatar edudel commented on June 4, 2024

thanks all ... I took the 2 approaches, however, @gabecoyne ViewPagerAndroid worked great !!

from react-native-scrollable-tab-view.

syarul avatar syarul commented on June 4, 2024

@gabecoyne +1, using ViewPagerAndroid makes this module obsolete, but nice experience getting the result we need.

from react-native-scrollable-tab-view.

Related Issues (20)

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.