Skip to content

Commit 68be355

Browse files
committed
update Example
1 parent 06c2431 commit 68be355

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Example/App.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,21 @@ type Props = {};
2828
export default class App extends Component<Props> {
2929
render() {
3030
return (
31+
<View style={{flex:1}}>
3132
<ScrollView
32-
refreshControl={
33-
<HuaWeiRefreshControl
34-
ref={ref=>this._hw = ref}
35-
onRefresh={()=>{
33+
style={{flex:1}}
34+
scrollEventThrottle={16}
35+
onScroll={e=>console.log(e.nativeEvent)}
36+
refreshControl={<HuaWeiRefreshControl
37+
ref={ref=>this._hw = ref}
38+
onRefresh={()=>{
3639
setTimeout(()=>{
37-
this._hw.finishRefresh();
40+
this._hw.finishRefresh();
3841
},1000)
39-
}}
40-
/>
41-
}
42+
}}
43+
/>}
4244
>
45+
4346
<View style={styles.container}>
4447
<Text style={styles.welcome}>
4548
Welcome to React Native!
@@ -55,16 +58,15 @@ export default class App extends Component<Props> {
5558
}}/>
5659
</View>
5760
</ScrollView>
61+
</View>
5862
);
5963
}
6064
}
6165

6266
const styles = StyleSheet.create({
6367
container: {
64-
flex: 1,
65-
justifyContent: 'center',
66-
alignItems: 'center',
6768
backgroundColor: '#F5FCFF',
69+
height:1000
6870
},
6971
welcome: {
7072
fontSize: 20,

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-mjrefresh": "^0.2.0",
13+
"react-native-mjrefresh": "^0.4.0",
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
@@ -4170,9 +4170,9 @@ react-native-indicators@^0.13.0:
41704170
dependencies:
41714171
prop-types "^15.5.10"
41724172

4173-
react-native-mjrefresh@^0.2.0:
4174-
version "0.2.0"
4175-
resolved "https://registry.npmjs.org/react-native-mjrefresh/-/react-native-mjrefresh-0.2.0.tgz#4912c6f8a9d5dc68ec391ec9a8c1480f741a1c25"
4173+
react-native-mjrefresh@^0.4.0:
4174+
version "0.4.0"
4175+
resolved "https://registry.npmjs.org/react-native-mjrefresh/-/react-native-mjrefresh-0.4.0.tgz#181cbe0a8f6889d0e3aa77082dc19d16d3eff8c6"
41764176

41774177
react-native-vector-icons@^4.6.0:
41784178
version "4.6.0"

0 commit comments

Comments
 (0)