Move scrollview with React button

Asked

Viewed 346 times

2

i have a scrollview in React Enable, but it moves only with the user’s touch. What method or how could I make it move when I press a button? if you want scrollview code:

      showsHorizontalScrollIndicator={false} //desabilita a barra de rolagem
      scrollEventThrottle={10}//frequencia de atualizacao da posicao
      pagingEnabled
      onScroll={
        Animated.event(
          [{ nativeEvent: { contentOffset: { x: this.animVal } } }]
        )
      }
    >

1 answer

1

Hello,

You can use the method scrollTo of the Act-Act or the scrollToEnd:

scrollTo([y]: 300, object, [animated]: true)

scrollToEnd([options]: object)

If you have any more questions about a look at the React-Native documentation she and her kkkk friend

https://facebook.github.io/react-native/docs/scrollview.html#scrollto

Live long and prosper

Browser other questions tagged

You are not signed in. Login or sign up in order to post.