RN瀑布流

提到瀑布流,國內(nèi)命名都是waterfalllist之類的,github能搜到,或多或少有些問題。。。 而且大多是國人寫的

后來同事繼續(xù)查,查到國外的masonry list了
shopify.github.io/flash-list/docs/guides/masonry/

才發(fā)現(xiàn),原來瀑布流來自國外,但國外不叫瀑布流,叫masonry list

代碼

<MasonryFlashList
      data={data}
      keyExtractor={keyExtractor}
      initialNumToRender={10}
      numColumns={2}
      columnWrapperStyle={styles.columnWrapper}
      renderItem={({ item, index }) => (
        <Item {...item} />
      )}
      refreshControl={
        <RefreshControl refreshing={isRefreshing} onRefresh={handleRefresh} />
      }
      onEndReached={handleLoadMore}
      ListFooterComponent={renderFooter}
      onEndReachedThreshold={0.1}
    />

iOS build報錯

[!] CocoaPods could not find compatible versions for pod "RNFlashList":
  In Podfile:
    RNFlashList (from `../node_modules/@shopify/flash-list`)

Specs satisfying the `RNFlashList (from `../node_modules/@shopify/flash-list`)` dependency were found, but they required a higher minimum deployment target.

查看node_modules/@shopify/flash-list/RNFlashList.podspec ,居然是11.0以上

...
s.platforms        = { :ios => '11.0', :tvos => '12.0' }
...
s.swift_version    = '5.0'
...

Q: swift_version 5.0 支持哪些 iOS 版本?
A: Swift 5.0 支持的最低 iOS 版本為 10.2。同時,Swift 5.0 還支持 iOS 11、iOS 12 和 iOS 13。

先強(qiáng)改iOS 11.0iOS 9試試的
找真機(jī)測試一下,發(fā)現(xiàn)云測、WeTest居然都沒有iOS 11以下的iPhone。。。

等后面再了解or實(shí)踐,再補(bǔ)充更多信息到這里

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

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

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