Answers for "auto scroll to bottom scrollview react native"

0

React Native Expo Scrollview Scroll to bottom

import React, { useRef } from 'react';
import { ScrollView } from 'react-native';

const ScreenComponent = (props) => {
  const scrollViewRef = useRef();
  return (
    <ScrollView
      ref={scrollViewRef}
      onContentSizeChange={() => scrollViewRef.current.scrollToEnd({ animated: true })}
    />
  );
};
Posted by: Guest on October-30-2021
0

auto scroll to view react-native

<ScrollView ref={view => this._scrollView = view} />
And set the scroll position elsewhere with:

scrollToRow(itemIndex) {
  this._scrollView.scrollTo({y:itemIndex * ROW_HEIGHT});
}
Posted by: Guest on September-17-2020

Code answers related to "auto scroll to bottom scrollview react native"

Browse Popular Code Answers by Language