javascript - React-Native 另一个 VirtualizedList 支持的容器
问题描述
升级到 react-native 0.61 后,我收到很多这样的警告:
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.
我应该使用的另一个VirtualizedList-backed container
是什么,为什么现在建议不要那样使用?
解决方案
如果有人仍在寻找@Ponleu 和@David Schilling 在这里描述的问题的建议(关于 FlatList 之上的内容),那么这就是我采取的方法:
<SafeAreaView style={{flex: 1}}>
<FlatList
data={data}
ListHeaderComponent={ContentThatGoesAboveTheFlatList}
ListFooterComponent={ContentThatGoesBelowTheFlatList} />
</SafeAreaView>
您可以在此处阅读有关此内容的更多信息:https ://facebook.github.io/react-native/docs/flatlist#listheadercomponent
希望它可以帮助某人。:)
推荐阅读
- docker - 无法从 docker compose 执行 sql 文件脚本
- c# - 使用 MultiDataTrigger 测试 TextBox 中的 0 和布尔值,该值在 XAML 中具有 StringFormat
- php - 如何在php中的mysql数据库中插入视频路径,视频名称。?
- c# - 如何使一个类型对于所有意图和目的都像字符串一样,因为我不能从字符串继承
- python - Django localflavor 字段覆盖中断表单
- android-studio - android 安全加密:java.lang.NoSuchMethodError:没有静态方法 aes256SivTemplate()
- python - 如何播放 wav 文件并使您的代码继续在 python 中运行?
- python - 并行运行函数并使用 python 将返回值保存在列表中
- node.js - 无法连接到 node.js 中的 socket.io 连接
- apache-spark - 根据同一列上的另一行值计算 Spark 列值