ScrollView and ScrollTo - React Native

0

In my project I have a "Comments" button, and when I click it the expectation is that it will do a "Scroll To" until the comments section of the same page.

But the file where the button is located is in different path / file where the comments field is located:

I basically have this:

MAIN vulgo telaPrincipal.js:

<View style={styles.container}>
        <ScrollView>
          <ViewBanner 
          dataSource = {this.state.dataSource}
          />
          <ViewButtons 
          navegar = {navigate}
          dataSource = {this.state.dataSource}
          /> 
          <ViewDescMap 
          dataSource = {this.state.dataSource}
          />
          <ViewComentarios
          dataSource = {this.state.dataSource}
          />
        </ScrollView>
      </View>

In it I invoke all the Views to fill the page.

In the ViewButtons file, the comment button looks like this:

<TouchableOpacity
    style={styles.button}>
    <Icon name="forum" size={30} color="#ca8a2d"  />
      <Text style={styles.legenda}>Comentários</Text>
</TouchableOpacity>

And what I want is that when the button is clicked, the page scrolls to the Comments field.

The project structure is this:

    
asked by anonymous 06.05.2018 / 04:19

0 answers