React Native 使用 FlatList 和 ScrollView 實現 下拉刷新時,RefreshControl 控件不起作用,
后來經查明,原來 RefreshControl 要加在 ScrollView 的屬性中,而不是 像普通 只有 FlatList 時,加在 FlatList 屬性中。
下面是代碼:
<ScrollView showsVerticalScrollIndicator={false}
//下拉刷新 ,有 ScrollView 需要加載ScrollView,無則加到 FlatList
refreshControl={
<RefreshControl
refreshing={this.state.isRefreshing}
onRefresh={this._onRefresh.bind(this, 0)}
/>
}
>
本博客地址: wukong1688
本文原文地址:https://www.cnblogs.com/wukong1688/p/10897675.html
轉載請著名出處!謝謝~~
