Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skv-headless/3a1391d3b52736e7367eb33c3bc1a52b to your computer and use it in GitHub Desktop.
Save skv-headless/3a1391d3b52736e7367eb33c3bc1a52b to your computer and use it in GitHub Desktop.
import React from 'react';
import {
Text,
TouchableOpacity,
} from 'react-native';
import ScrollableTabView, {DefaultTabBar} from 'react-native-scrollable-tab-view';
export default React.createClass({
render() {
return <ScrollableTabView
style={{marginTop: 20, }}
ref={(tabView) => {
if (tabView != null) {
this.tabView = tabView;
}
}}
renderTabBar={() => <DefaultTabBar />}
>
<Text tabLabel='Tab #1'>My</Text>
<Text tabLabel='Tab #2'>favorite</Text>
<Text tabLabel='Tab #3'>project</Text>
<TouchableOpacity tabLabel='Back' onPress={this.back.bind(this)}>
<Text>Hello</Text>
</TouchableOpacity>
</ScrollableTabView>;
},
back() {
this.tabView.goToPage(0);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment