rn-viewpager
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "rn-viewpager", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "ViewPager component for react-native, same api on both android and ios.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,1 +0,75 @@ | ||
# React-Native-ViewPager | ||
# React-Native-ViewPager | ||
## Usage | ||
### Install from npm: | ||
`npm install --save rn-viewpager` | ||
### Integrate into your app: | ||
``` | ||
import React, {Component, StyleSheet, View, Text} from 'react-native'; | ||
import {IndicatorViewPager, PagerTitleIndicator, PagerDotIndicator} from 'rn-viewpager'; | ||
export default class ViewPagerPage extends Component { | ||
state = { | ||
count: 0 | ||
}; | ||
render() { | ||
console.log('render:' + this.state.count); | ||
return ( | ||
<View style={{flex:1}}> | ||
<IndicatorViewPager | ||
style={{height:200}} | ||
indicator={this._renderDotIndicator()} | ||
> | ||
<View style={{backgroundColor:'cadetblue'}}> | ||
<Text>{'count' + this.state.count}</Text> | ||
</View> | ||
<View style={{backgroundColor:'cornflowerblue'}}> | ||
<Text>page two</Text> | ||
</View> | ||
<View style={{backgroundColor:'#1AA094'}}> | ||
<Text>page three</Text> | ||
</View> | ||
</IndicatorViewPager> | ||
<IndicatorViewPager | ||
style={{flex:1,marginTop:10}} | ||
indicator={this._renderTitleIndicator()} | ||
> | ||
<View style={{backgroundColor:'cadetblue'}}> | ||
<Text>{'count' + this.state.count}</Text> | ||
</View> | ||
<View style={{backgroundColor:'cornflowerblue'}}> | ||
<Text>page two</Text> | ||
</View> | ||
<View style={{backgroundColor:'#1AA094'}}> | ||
<Text>page three</Text> | ||
</View> | ||
</IndicatorViewPager> | ||
</View> | ||
); | ||
} | ||
_renderTitleIndicator() { | ||
return ( | ||
<PagerTitleIndicator | ||
titles={['one', 'two', 'three']} | ||
/> | ||
); | ||
} | ||
_renderDotIndicator() { | ||
return ( | ||
<PagerDotIndicator | ||
pageCount={3} | ||
/> | ||
); | ||
} | ||
} | ||
``` | ||
## TODO |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46235
75