如何在React Native中设置FlatList的刷新指示器? [英] How to set Refresh Indicator of FlatList in react native?
本文介绍了如何在React Native中设置FlatList的刷新指示器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在react native中设置平面列表的刷新指示器,但不知道该怎么做.列表视图具有此道具:
I'm trying to set the refresh indicator of flat list in react native but don't know how to do it. List View has this prop :
refreshControl={<RefreshControl
colors={["#9Bd35A", "#689F38"]}
refreshing={this.props.refreshing}
onRefresh={this._onRefresh.bind(this)}
/>
}
但是平面列表只有这些:
But Flat List has only these :
refreshing={this.props.loading}
onRefresh={this._onRefresh.bind(this)}
推荐答案
我找到了解决方案!可能是假人,但是FlatList也有一个名为refreshControl的道具,如ListView,但我只是没有测试它!就是这样:
I found the solution! It might be the dummy but FlatList also has a prop called refreshControl like ListView but I just didn't test it! Just like this:
<FlatList
refreshControl={<RefreshControl
colors={["#9Bd35A", "#689F38"]}
refreshing={this.props.refreshing}
onRefresh={this._onRefresh.bind(this)} />}
/>
这篇关于如何在React Native中设置FlatList的刷新指示器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文