Comments (10)
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.
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.
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.
Might be related to facebook/react-native#3557 ?
from react-native-scrollable-tab-view.
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.
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.
I've created a new version with ViewPagerAndroid:
https://gist.github.com/gabecoyne/3b9ffa89b07ac4f42dc7
from react-native-scrollable-tab-view.
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.
thanks all ... I took the 2 approaches, however, @gabecoyne ViewPagerAndroid worked great !!
from react-native-scrollable-tab-view.
@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)
- \
- this.scrollView.geNode is not a function
- when a flatlist inside the tabview,the flatlist's pullDownToRefresh will not work! HOT 1
- ScrollableTabView下多个Flatlist,Android数据不刷新
- Refresh the component on every tab change HOT 1
- tabContainer but no owner was set. HOT 2
- Weird animation behavior on IOS HOT 1
- ios. version. scroll screen. show not normail but android env is ok HOT 1
- scrollView.getNode HOT 1
- ViewPropTypes will be removed from React Native HOT 2
- Tried to register two views with the same name RNCViewPager HOT 2
- TypeError: Cannot read property 'setPageWithoutAnimation' of undefined on android HOT 3
- Please publish a new npm version? HOT 4
- onChangeTab results in undefined error HOT 1
- Element ref was specified as a string (tabContainer) but no owner was set. HOT 3
- please update new version to npm,thank you very much!
- ViewPropTypes will be removed from React Native HOT 1
- tabBarUnderline not match current
- How can i get current page HOT 1
- It's so old
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-scrollable-tab-view.