刷新前react native listview 实现下拉刷新(RefreshControl)react native listview 实现下拉刷新(RefreshControl)

刷新后

清空数组 arr.splice(0,arr.length
)

代码如下 

<ListView
    refreshControl={
        <RefreshControl
            refreshing={this.state.refreshing}
            onRefresh={this._onRefresh}
        />
    }
    initialListSize={5}
    dataSource={this.state.dataSource}
    renderRow={this._renderRow}
/>
_onRefresh() {
    this.setState({refreshing: true});
    setTimeout(()=>{
        array.push('row 8');
        THUMB_URLS.splice(0,THUMB_URLS.length);
        THUMB_URLS.push(require('./8.jpg'));
        this.setState({refreshing: false,
            dataSource:ds.cloneWithRows(array)});

    },2000)
}


相关文章:

  • 2021-08-18
  • 2021-11-05
  • 2022-12-23
  • 2022-01-03
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-14
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
  • 2022-03-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案