React-Native 另一个 VirtualizedList 支持的容器 [英] React-Native another VirtualizedList-backed container

查看:28
本文介绍了React-Native 另一个 VirtualizedList 支持的容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到 react-native 0.61 后,我收到了很多这样的警告:

After upgrading to react-native 0.61 i get a lot of warnings like that:

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.

我应该使用的另一个 VirtualizedList-backed 容器 是什么,为什么现在建议不要那样使用?

What is the other VirtualizedList-backed container that i should use, and why is it now advised not to use like that?

推荐答案

如果有人仍在寻找对 @Ponleu 和 @David Schilling 在此处描述的问题的建议(关于高于 FlatList 的内容),那么这就是我采取的方法:

If someone's still looking for a suggestion to the problem that @Ponleu and @David Schilling have described here (regarding content that goes above the FlatList), then this is the approach I took:

<SafeAreaView style={{flex: 1}}>
    <FlatList
      data={data}
      ListHeaderComponent={ContentThatGoesAboveTheFlatList}
      ListFooterComponent={ContentThatGoesBelowTheFlatList} />
</SafeAreaView>

您可以在此处阅读更多相关信息:https://facebook.github.io/react-native/docs/flatlist#listheadercomponent

You can read more about this here: https://facebook.github.io/react-native/docs/flatlist#listheadercomponent

希望对某人有所帮助.:)

Hopefully it helps someone. :)

这篇关于React-Native 另一个 VirtualizedList 支持的容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆