I use the ListView\'s scrollToEnd
, but it doesn\'t work, but it worked for scrollTo
. What should I do to deal with it.
Rendering takes time so setTimeout() before scrolling to end will work. You can, however, use the onLayout() method.
export default MyComponent extends React.Component {
constructor(props) {
super(props)
this.scrollToBottom = this.scrollToBottom.bind(this)
}
scrollToBottom() {
this.refs.myView.scrollToEnd()
}
render() {
return {
}
}
Note: ListView is now deprecated.