gpt4 book ai didi

react-native - react 原生 NestedScrollEnabled 做什么?

转载 作者:行者123 更新时间:2023-12-04 10:43:23 25 4
gpt4 key购买 nike

自从我第一次见到文档以来,ScrollViewProps 或从中派生 Prop 的组件(SectionList、FlatList、VirtualizedList)上可用的这个属性一直困扰着我。

说明只说Enables nested scrolling for Android API level 21+.但没有更深入地了解 API 21+(或 API < 21)上的实际错误或您需要此属性的实际用例。

我已经在真实的 android 设备上进行了多次测试,并且在所有这些设备上,嵌套滚动(使用 ScrollView 或其他库存组件)都可以正常工作 - 无论是否将此 Prop 设置为 true - 并且在水平和垂直方向。

那么,这个 Prop 究竟有什么作用呢?你能举一个例子说明这个 Prop 有什么用处,或者没有它滚动就不能正常工作吗?

另外,如果我将所有这些滚动组件设置为 true 是否会造成伤害?

最佳答案

符合 Android's website

NestedScrollView is just like ScrollView, but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. Nested scrolling is enabled by default.



这意味着:

NestedScrollView is when you need a scrollView inside another scrollView



这在较新版本的 android 和所有 IOS 版本上默认启用,但您可以将其设置为 true它适用于一切。

使用示例:

enter image description here

关于react-native - react 原生 NestedScrollEnabled 做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59828595/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com