首页 > 解决方案 > React native: Is it possible to set initial position to SectionList without using scrollToLocation

问题描述

I want to set an initial list position (SectionList) without using scrollToLocation. Is that possible? tried to look it up but couldn't fund anything about it.

Thanks in advance.

标签: react-nativereact-native-sectionlist

解决方案


不,这是不可能的。

我能想到的一个解决方案是你 set initialNumToRender,其中有那个初始位置。但这在处理大型列表时会导致内存问题。

另一种解决方法是在列表上方显示一个加载器并在scrollToLocation没有动画的情况下使用。然后隐藏加载器。


推荐阅读