Created
February 17, 2017 22:44
-
-
Save kelvinlemus/87d5af6330d6d4db6ae04db12844bf28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| listHeight: null, | |
| footerY: null | |
| } | |
| } | |
| let scrollDistance = this.state.listHeight - this.state.footerY | |
| this.listView.scrollTo({x: this.state.listHeight, y: this.state.footerY, animated: true}) | |
| <ListView | |
| ref={(component)=> this.listView = component } | |
| onLayout={(event) => { | |
| let layout = event.nativeEvent.layout | |
| this.setState({ | |
| listHeight : layout.height | |
| }) | |
| }} | |
| renderFooter={() => { | |
| return ( | |
| <View | |
| onLayout={(event)=>{ | |
| let layout = event.nativeEvent.layout | |
| this.setState({ | |
| footerY : layout.y | |
| }) | |
| }}> | |
| </View> | |
| ) | |
| }} | |
| initialListSize={120} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment