[RN] React Native 使用 FlatList 和 ScrollView 的下拉刷新问题

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

转载请著名出处!谢谢~~

posted @ 2019-05-21 06:55  wukong1688  阅读(2869)  评论(0编辑  收藏  举报