pullview使用flatlist下拉上拉

PullView

站在諸多巨人的肩上,寫的這個(gè)庫(kù)。自己用著感覺(jué)還行,大家可以試試。
scrollview&&FlatList android&&ios
1:flatlist與scrollview下拉刷新上拉加載更多
2:沒(méi)有網(wǎng)絡(luò)沒(méi)有數(shù)據(jù)狀態(tài)頁(yè)面。
3:解決react-native-pull中iOS下拉頭部出現(xiàn)空白問(wèn)題。

GitHub:https://github.com/wuyunqiang/PullView/blob/master/README.md

參考react-native-pull和react-native-refreshable-flatlist。

效果圖:


image
image

使用方式直接拷貝到文件目錄下,導(dǎo)入組件即可:
pulllist=>使用flatlist

 onPullRelease = (resolve) => {
        //請(qǐng)求數(shù)據(jù)然后執(zhí)行 
          this.list && this.list.setData(result);
          resolve()
        }
        
render() {
        return (<PullList
            style={{width: WIDTH,backgroundColor:'#f5f5f5'}}
            ref={(list)=> this.list = list}
            onPullRelease={this.onPullRelease}
            onEndReached={()=>{ this.list&&this.list.addData([]);}}
            renderItem={this.item}
            numColumns={1}
            initialNumToRender={5}
            key={'list'}
        />)}

pullview=>使用scrollview

 onPullRelease = (resolve) => {
        //請(qǐng)求數(shù)據(jù)然后執(zhí)行 
          resolve()
        }
        
    render() {
        return (
            <PullView
                style={{width: WIDTH,backgroundColor:'#f5f5f5'}}
                onPullRelease={this.onPullRelease}
            >
             //一些組件
            </PullView>
        )
    }

下拉上拉在iOS上,不會(huì)出現(xiàn)空白現(xiàn)象。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容