Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
react原生refesh控件在android上工作吗?_Android_Facebook_React Native_React Native Android - Fatal编程技术网

react原生refesh控件在android上工作吗?

react原生refesh控件在android上工作吗?,android,facebook,react-native,react-native-android,Android,Facebook,React Native,React Native Android,我在IOS上使用了React本机刷新控制 我在安卓sim卡上运行它,但它不工作 错误表示未处理的承诺被拒绝 以下是文件的修剪版本,以便您可以查看设置: import React, { Component } from 'react'; import { RefreshControl, } from 'react-native'; export default class Products extends Component { _onRefresh() { this.setS

我在IOS上使用了React本机刷新控制

我在安卓sim卡上运行它,但它不工作

错误表示未处理的承诺被拒绝

以下是文件的修剪版本,以便您可以查看设置:

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>
    }
  }
}
import React,{Component}来自'React';
进口{
刷新控制,
}从“反应本机”;
导出默认类产品扩展组件{
_onRefresh(){
this.setState({刷新:true});
这个.likedProducts()
}
render(){
返回(
...
}
}
}

我不知道是否支持在Android上使用带RefreshControl的ScrollView。我建议改为使用。在Android和iOS上,您可以通过本机集成的方式进行刷新。

我可以确认它是否适用于Android和iOS。我收到的错误来自其他地方