【发布时间】:2017-11-07 12:00:43
【问题描述】:
我在 IOS 上有 React Native Refresh 控件。
https://facebook.github.io/react-native/docs/refreshcontrol.html
我在 android sim 上运行它,但它不起作用。
错误表示未处理的 Promise Rejection。
这是文件的修剪版本,因此您可以看到设置:
import React, { Component } from 'react';
import {
RefreshControl,
} from 'react-native';
export default class Products extends Component {
_onRefresh() {
this.setState({refreshing: true});
this.likedProducts()
}
render() {
return (
<View style={styles.container}>
<ScrollView
contentContainerStyle={styles.scrollContent}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
refreshControl={
<RefreshControl
refreshing={this.state.refreshing}
onRefresh={this._onRefresh.bind(this)}
/>
}
>
...
</ScrollView>
</View>
}
}
}
【问题讨论】:
标签: android facebook react-native react-native-android