gameboyVito / react-native-ultimate-listview

A high performance FlatList providing customised pull-to-refresh | auto-pagination & infinite-scrolling | gridview layout | swipeable-row.
https://www.npmjs.com/package/react-native-ultimate-listview
MIT License
540 stars 87 forks source link

This new version Refersh header is flashing. #2

Closed hongyang51 closed 7 years ago

hongyang51 commented 7 years ago

The process is drop-down Pull To Refresh ---> ' Refreshing...' ------> immediately back ------>Pull To Refresh now is flashing. i need your help? thanks

hongyang51 commented 7 years ago

refreshableTitleDidRefreshDuration this attribute is control ?

gameboyVito commented 7 years ago

I remove the refreshableTitleDidRefreshDuration props since it cause some issues. You may try to set both of refreshableTitleWillRefresh and refreshableTitleInRefreshing to "Pull to refresh" to have a quick fix. If you still have this issue, please let me know. Thanks.

gameboyVito commented 7 years ago

I am working on a new version, so if you feel it unstable, please downgrade to v1.0.18. Thanks for choosing my module. ^.^

gameboyVito commented 7 years ago

Hi, I have upgraded this module to v2.0.2 and provided more powerful API to interact with the RefreshView. Please check the latest Wiki and thanks for your report.

hongyang51 commented 7 years ago

@gameboyVito 谢谢您的帮助啊! 我升级到 最新版本之后 使用经典的模式 还是下拉到一定程度 ios 还是会 突然蹿到上面去. 用高级的 就好太多了 谢谢开源这么棒的项目..

hongyang51 commented 7 years ago

现在我 动态删除一条数据之后 有的页面刷新少了一条, 有的页面不刷新 但是 row 方法都走了 但是数据还是原来的数据.. 不知道怎么搞了...

gameboyVito commented 7 years ago

You need to call updateDataSource(newArray) to update the dataSource of your listview. You can reference on my code, be careful to pass the rowID to update the specified rowView.

updateListItem = (rowID) => {
        const dataSource = this._listView.getRows();
        const newArray = dataSource.slice();
        newArray[rowID] = {
                        ...dataSource[rowID],
                        stars: dataSource[rowID].stars - 1,
                        favourite: false
       };
     //or just remove an item from that array using "filter()"
    //something like this: newArray = newArray.filter(message => message._id !== cid);
      this._listView.updateDataSource(newArray);
}

<UltimateListView ref={(ref) => this._listView = ref}/>