How to know the state of scroll (up or down) in FlatList?
问题 How to know the state of the scroll in FlatList? Like scrolling up or scrolling down? I want to know the state scrolling up or down to show or hide header in FlatList. 回答1: Use the onScroll property as below. (Official) <ScrollView onScroll={this._onScroll} /> _onScroll = (event) { console.log(event.nativeEvent.contentOffset.y); }, And for guarantee getting the value of scrolling's last frame, you need to set a property scrollEventThrottle={16} . 回答2: Actually, the FlatList component can use