1.学习拖拽刷新列表

修改App.js的,定义一个isRefreshing:false

react native 学习笔记17

伪造一下新的商品数据;

 

react native 学习笔记17

 

刷新数据:

_onRefresh =() =>{
    this.setState({isRefreshing:true});
    setTimeout(()=>{

        const products=Array.from(new Array(10)).map((value,index) =>({
            image:require('./images/image_2.jpg'),
            title:'新商品'+index,
            subTitle:'新商品描述'+index

        }));
        this.setState({isRefreshing:false, dataSource:ds.cloneWithRows(products)});
    },2000);
    // setTimeout(()=> {
    //    this.setState({isRefreshing:false});
    // },2000);
}

相关文章:

  • 2021-10-26
  • 2022-01-22
  • 2022-01-10
  • 2022-01-14
  • 2021-10-11
  • 2017-12-08
猜你喜欢
  • 2020-01-09
  • 2021-08-20
  • 2021-08-18
  • 2021-06-28
  • 2021-12-21
  • 2021-04-27
相关资源
相似解决方案