提到瀑布流,國內(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.0為iOS 9試試的
找真機(jī)測試一下,發(fā)現(xiàn)云測、WeTest居然都沒有iOS 11以下的iPhone。。。
等后面再了解or實(shí)踐,再補(bǔ)充更多信息到這里