I use the ListView's scrollToEnd
, but it doesn't work, but it worked for scrollTo
. What should I do to deal with it.
Using ScrollViewScrollViews can be configured to allow paging through views using swiping gestures by using the pagingEnabled props. Swiping horizontally between views can also be implemented on Android using the ViewPager component. On iOS a ScrollView with a single item can be used to allow the user to zoom content.
If your list items are of equal height, you can use them to implement scrolling to a specific item by calling scrollTo({y:itemIndex * ROW_HEIGHT}) .
There is a workaround, wrap it in a setTimeout
like so:
componentDidMount() {
setTimeout(() => {
this.refs.dateList.scrollToEnd();
}, 50);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With