Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.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
ScrollView中的WebView在刷起本地Android时调用refreshControl_Android_React Native_Webview_Scrollview_Pull To Refresh - Fatal编程技术网

ScrollView中的WebView在刷起本地Android时调用refreshControl

ScrollView中的WebView在刷起本地Android时调用refreshControl,android,react-native,webview,scrollview,pull-to-refresh,Android,React Native,Webview,Scrollview,Pull To Refresh,我在React原生应用程序的ScrollView中有一个WebView。ScrollView具有refreshControl道具,因此我可以在到达应用程序顶部时刷新WebView 问题是:我滚动WebView没有问题,但是每当我向上滑动到页面顶部时,不管我是在页面的末尾、中间还是开头,刷新控件总是被触发 RefreshControl在scrollY:0且scrollY始终为0时触发,因为滚动的不是ScrollView而是WebView,因此ScrollView始终为scrollY:0 我已经在W

我在React原生应用程序的ScrollView中有一个WebView。ScrollView具有refreshControl道具,因此我可以在到达应用程序顶部时刷新WebView

问题是:我滚动WebView没有问题,但是每当我向上滑动到页面顶部时,不管我是在页面的末尾、中间还是开头,刷新控件总是被触发

RefreshControl在scrollY:0且scrollY始终为0时触发,因为滚动的不是ScrollView而是WebView,因此ScrollView始终为scrollY:0

我已经在WebView和ScrollView上尝试了scrollEnabled道具,但都没有成功

下面是代码现在的样子:

<View style={{flex: 1}}>
    <ScrollView
      contentContainerStyle={{flex: 1}}
      refreshControl={
        <RefreshControl
          refreshing={this.state.refreshing}
          onRefresh={this._onRefresh.bind(this)}
        />
      }
    >
      <WebView
        ref="webview"
        source={{uri: initialUrl}}
      />
    </ScrollView>
</View>

我移除了所有的道具试图重新开始,但我总是遇到同样的问题。在iOS上工作正常,没有这个问题


是的,我确实在这个母视图中包含了其他内容。

奇怪的是,我从contentContainerStyle中删除了样式,它工作得很好。我只是想把可能妨碍功能的多余东西去掉。也许这是一个错误,但是现在请尽量避免使用Flexbox设置。

遇到了同样的问题-没有
contentContainerStyle
,webview是不可见的,并且webview上有固定的高度,刷新仍然被调用,这太不幸了<代码>RN 0.63.1和
react native webview ^10.3.2