react-native-scrollable-view
v0.1.0
Published
Inspired by https://github.com/brentvatne/react-native-scrollable-tab-view
Readme
react-native-scrollable-view
Inspired by https://github.com/brentvatne/react-native-scrollable-tab-view
I want to use scrollable view without tab. I cannot find react-native plugin so I forked react-native-scrollable-tab-view and strip of tab component.
Thanks @brentvatne!
Tested with react-native 0.20
Add it to your project
- Run
npm install react-native-scrollable-view --save var ScrollableTabView = require('react-native-scrollable-tab-view');
Demo
Basic usage
var ScrollableView = require('react-native-scrollable-view');
var App = React.createClass({
render() {
return (
<ScrollableView>
<Text> View 1</Text>
<Text> View 2</Text>
<Text> View 3</Text>
</ScrollableView>
);
}
});Example
See examples/FacebookTabsExample.
Props
onChangePage(Function) - function to call when Page 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 selectedonScroll(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 page(can be buggy see #126style(View.propTypes.style)contentProps(Object) - props that are applied to rootScrollView/ViewPagerAndroid. Note that overriding defaults set by the library may break functionality; see the source for details.
MIT Licensed
