Answers for "react native scrollview auto scroll to bottom"

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 "react native scrollview auto scroll to bottom"

Browse Popular Code Answers by Language