Skip to content

Commit c2e4793

Browse files
committed
update Example
1 parent 30ef895 commit c2e4793

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Example/ListViewExample1.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {Component} from 'react';
2-
import {StyleSheet, View, Text,ListView,ScrollView} from 'react-native';
2+
import {StyleSheet, View, Text,ListView,ScrollView,ViewPagerAndroid} from 'react-native';
33
import PropTypes from 'prop-types';
44
import HuaWeiRefreshControl from './HuaWeiRefreshControl';
55

@@ -20,6 +20,16 @@ export default class ListViewExample1 extends Component {
2020
return (
2121
<View style={{flex: 1}}>
2222
<ListView
23+
renderHeader={()=><ViewPagerAndroid
24+
style={styles.viewPager}
25+
initialPage={0}>
26+
<View style={styles.pageStyle} key="1">
27+
<Text>First page</Text>
28+
</View>
29+
<View style={styles.pageStyle} key="2">
30+
<Text>Second page</Text>
31+
</View>
32+
</ViewPagerAndroid>}
2333
refreshControl={<HuaWeiRefreshControl
2434
ref={ref=>this._hw = ref}
2535
onRefresh={this._onRefresh}
@@ -30,4 +40,14 @@ export default class ListViewExample1 extends Component {
3040
</View>
3141
)
3242
}
33-
}
43+
}
44+
const styles = StyleSheet.create({
45+
viewPager: {
46+
flex: 1,
47+
height:300
48+
},
49+
pageStyle: {
50+
alignItems: 'center',
51+
padding: 20,
52+
}
53+
})

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"react": "16.3.1",
1111
"react-native": "0.55.4",
1212
"react-native-indicators": "^0.13.0",
13-
"react-native-smartrefreshlayout": "^0.5.7",
13+
"react-native-smartrefreshlayout": "^0.5.8",
1414
"react-native-vector-icons": "^4.6.0"
1515
},
1616
"devDependencies": {

Example/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4171,9 +4171,9 @@ react-native-indicators@^0.13.0:
41714171
dependencies:
41724172
prop-types "^15.5.10"
41734173

4174-
react-native-smartrefreshlayout@^0.5.7:
4175-
version "0.5.7"
4176-
resolved "https://registry.npmjs.org/react-native-smartrefreshlayout/-/react-native-smartrefreshlayout-0.5.7.tgz#69a941363b92889d42a6307bed5fd77c72e27939"
4174+
react-native-smartrefreshlayout@^0.5.8:
4175+
version "0.5.8"
4176+
resolved "https://registry.npmjs.org/react-native-smartrefreshlayout/-/react-native-smartrefreshlayout-0.5.8.tgz#f388e3fb7b075858eac9b6a538e012785d6201b2"
41774177
dependencies:
41784178
prop-types "*"
41794179

0 commit comments

Comments
 (0)