Created
June 20, 2016 14:23
-
-
Save skv-headless/3a1391d3b52736e7367eb33c3bc1a52b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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