I have a bunch of data in a horizontal scrolling ListView (within a ReactNative app). I want to scroll the text over the course of about 3 minutes (this is not just bouncing or an event). I can't find any example of how to do it. The ListView.scrollTo() function is all that seems to fit, but it doesn't allow such a controlled gradual scroll. Also, I'm keen to use the native animation if possible, so perhaps a transform?
export default class App extends React.Component {
// Initialize the hardcoded data
constructor(props) {
super(props);
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
this.state = {
dataSource: ds.cloneWithRows([
'John', 'Joel', 'James', 'Jimmy', 'Jackson', 'Jillian', 'Julie', 'Devin',
'Daryl', 'Donny', 'Frederick', 'Fanny', 'Fanulf', 'Gordon'
])
};
}
render() {
return (
<View style={styles.container}>
<ListView
horizontal={true}
style={styles.content}
dataSource={this.state.dataSource}
renderRow={(rowData) => <Text>{rowData}</Text>}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
content: {
flex: 1,
padding: 5
}
});