For a chat-like app, I want to keep a ScrollView component scrolled to the bottom, because newest messages appear under the older ones. Can we adjust the scroll
This method is a little bit hacky but I couldn't find a better way
var footerY; //Y position of the dummy view
render() {
return (
// This is where all the things that you want to display in the scroll view goes
// Below is the dummy View
{
footerY = e.nativeEvent.layout.y;
}}/>
//Below is the button to scroll to the bottom
{ this.refs._scrollView.scrollTo(footerY); }}>
Scroll to Bottom
);
}