Javascript 如何在react native';s实验窗口ListView
我想在react native的实验性WindowedListView组件上实现一个滚动恢复机制 我尝试使用Javascript 如何在react native';s实验窗口ListView,javascript,react-native,scroll,Javascript,React Native,Scroll,我想在react native的实验性WindowedListView组件上实现一个滚动恢复机制 我尝试使用scrollTo函数设置底层ScrollView滚动位置,但是WindowedListView本身没有滚动到正确的位置。我怀疑原因是它以增量方式呈现行,因此它不会直接显示目标行 // WindowedListViewSource - refer to https://github.com/facebook/react-native/blob/master/Libraries/Experi
scrollTo
函数设置底层ScrollView滚动位置,但是WindowedListView本身没有滚动到正确的位置。我怀疑原因是它以增量方式呈现行,因此它不会直接显示目标行
// WindowedListViewSource - refer to https://github.com/facebook/react-native/blob/master/Libraries/Experimental/WindowedListView.js
componentDidMount() {
this._scrollRef &&
this._scrollRef.scrollToOffset &&
this._scrollRef.scrollToOffset({offset, animated});
} // this didn't work :(
预期结果应呈现列表,并滚动至正确的位置/偏移
实际的结果是,列表被滚动,但没有滚动到正确的位置——距离顶部只有10-20px,但没有任何错误消息