1.学习拖拽刷新列表
修改App.js的,定义一个isRefreshing:false
伪造一下新的商品数据;
刷新数据:
_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);
}