-
Notifications
You must be signed in to change notification settings - Fork 9
设置列数为2,只显示奇数列数据 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
可以贴一下你的列表配置代码吗 |
<WaterfallFlow } showsVerticalScrollIndicator={false} initialNumToRender={20} numColumns={2} onEndReachedThreshold={0.1} onEndReached={this.onScrollEndReached.bind(this)} onViewableItemsChanged={this.onViewableItemsChanged} // renderItem={({ item, index, columnIndex }) => this.rendItem(item, index, columnIndex)} renderItem={({ item, index, columnIndex }) => { return ( <View style={{ backgroundColor: 'red', height: 100, width: (cardWidth - 16 - 10) / 2, paddingLeft: columnIndex == 0 ? 16 : 10, flex: 1 }} > <Text style={{ width: '100%', backgroundColor: 'green' }}>index: {index} ) }} /> |
renderItem里面width和flex:1是不需要的 |
去掉renderItem里面width和flex:1,应该是没有问题的吧 |
我看你代码view和text都没有闭合,闭合后我去掉了width和flex,能够正常展示的 |
版本是最新版吗 |
"react-native-waterfall-flow": "^1.1.4" |
应该是嵌套scrollview了吧,我这里也是拿不到渲染后宽度,onContentSizeChange 不调用 |
设置完列数后,只显示了奇数列的数据,偶数列的是空白的
The text was updated successfully, but these errors were encountered: