刷新控件触发后,响应本机Stop ScrollView事件

我正在使用React-Native 0.59.9版本。

我有一个ScrollView,里面有一个RefreshControl。

     <ScrollView
      ref="_scrollView"

      onScrollEndDrag={({ nativeEvent }) => {
        if (this.isCloseToBottom(nativeEvent)) {

          console.log("scrolling")

        }
      }}
      refreshControl={
        <RefreshControl
          refreshing={this.state.loading}
          onRefresh={() =>{this.preventDefault=true; this.onRefresh()}}
          tintColor="#FBE40D"
          progressBackgroundColor="#FBE40D"
        />
      }
    >

当我尝试通过拉下页面(使用RefreshControl)刷新页面时,然后连同onRefresh方法一起,触发onScrollEndDrag事件。

有趣的是,它仅在ios中发生,而不是在Android上发生。 如果onScrollEndDrag已经触发,有什么方法可以停止onRefresh吗?

(很明显preventDefault无效)。

请告知我是否可以提供更多详细信息。

luke_wonder 回答:刷新控件触发后,响应本机Stop ScrollView事件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3169715.html

大家都在问