是否有可能在React Native的ScrollView中有多个onScroll事件?ScrollView上的多个onScroll事件React Native?
我遇到的问题是,我有渲染成分的ListView
像这样:
<ListView
onScroll={Animated.event(
[{nativeEvent: {contentOffset: {y: this.state.scrollY}}}],
{onScroll: this.props.onScroll}
)}
scrollEventThrottle={10}
dataSource={stuff}
removeClippedSubviews={false}
renderSeparator={this.makeSeparator}
renderRow={this.makeStuff}
enableEmptySections={true}
/>
正如你可以看到已经有订阅了它的Animaion事件,但我也希望能够如果我想为渲染此组件的更高组件提供不同的滚动功能,请通过this.props.onScroll
。
这可能吗?有任何想法吗?
这为我工作,即使没有使用 “useNativeDriver” – pucky124