Przewiń do wejścia na przycisk Kliknij React Native
I cant gurantee this is the best approach.
Add this.scroll.scrollTo({ x: calculatedStartPositionOfTheScreen}) to your button Press handler https://facebook.github.io/react-native/docs/scrollview#scrollto
e.g
<View>
...
<View style={styles.ButtonContainer}>
<Button title="Screen 1" onPress={() => { this.scroll.scrollTo({ x: 0 }) }} />
</View>
<View style={styles.ButtonContainer}>
<Button title="Screen 2" onPress={() => { this.scroll.scrollTo({ x: screenWidth }) }} />
</View>
<View style={styles.ButtonContainer}>
<Button title="Screen 3" onPress={() => { this.scroll.scrollTo({ x: screenWidth * 2 }) }} />
</View>
...
<ScrollView
horizontal={true}
pagingEnabled={true}
showsHorizontalScrollIndicator={false}
ref={(node) => this.scroll = node}
>
...
</ScrollView>
</View >
Vivacious Vendace