[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

轉載請著名出處!謝謝~~


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM