gpt4 book ai didi

react native SectionList 滚动到

转载 作者:行者123 更新时间:2023-12-04 05:06:58 26 4
gpt4 key购买 nike

我是 react-native 的新手,尝试过使用 SectionList。到目前为止一切正常。但是,我似乎无法使用 facebook 文档中定义的 scrollToLocation 函数。有人试过使用它或类似的东西吗?基本上,我想滚动到特定的部分和项目。

return Promise.all([
props.orderActions.set(orders, true),
props.orderActions.set(orders, false),
]).then(() => {
return this._ordersList.scrollToLocation({
animated: false,
sectionIndex: 0,
itemIndex: historyItems.length - 1
})
})

_ordersList 是对 SectionList 组件的引用。

谢谢!

最佳答案

升级到 0.45 就可以了。有性能问题,但通过使用 PureComponent 设法解决了它

关于 react native SectionList 滚动到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44472196/

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