Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android 使用UltimateRefreshView 进入app会 一直是下拉状态 提示‘正在刷新’ #42

Open
gao520sun opened this issue Nov 13, 2017 · 2 comments

Comments

@gao520sun
Copy link

No description provided.

@koupeng
Copy link

koupeng commented Jan 9, 2018

我也是这个问题。

@FaiChou
Copy link

FaiChou commented May 29, 2018

源码有问题

refreshableScrollView.ios.js line123

        this._isRefreshing = true
        this.setState({
          refreshStatus: RefreshStatus.refreshing,
          refreshTitle: this.props.refreshableTitleRefreshing
        })

setState是异步的, 刚刷新完并不会立即将状态设为refreshing
但是此时:

refreshableScrollView.ios.js line152

  onRefreshEnd = () => {
    // console.log('onRefreshEnd()');
    if (this.state.refreshStatus === RefreshStatus.refreshing) {

却判断了状态是不是refreshing . 可以去掉这个判断.

也可以在调用时候加个延迟, 或者放到数据请求完成/失败之后.

//      <UltimateRefreshView
//          onRefresh={this.pageRefresh}
//        >
 pageRefresh = (endRefresh) => {
    this.loadData();
    setTimeout(() => {
        endRefresh();
    }, 500);
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants