提到瀑布流,国内命名都是waterfalllist之类的,github能搜到,或多或少有些问题。。。 而且大多是国人写的
后来同事继续查,查到国外的masonry list了
shopify.github.io/flash-list/docs/guides/masonry/
才发现,原来瀑布流来自国外,但国外不叫
瀑布流
,叫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。
先强改iOS 11.0
为iOS 9
试试的
找真机测试一下,发现云测、WeTest居然都没有iOS 11以下的iPhone。。。
等后面再了解or实践,再补充更多信息到这里
网友评论