I decided to implement a basic map function to display our array on the screen:
let numbers = new Array(41);
for (let i = 0, num = 0; i < numbers.length; i++, num += 5) {
numbers[i] = num;
}
{numbers.map((item, index) => {
return (
<Animated.View
key={index}
style={[
{ transform: [{ translateY }] },
]}
>
<Text style={styles.text} onPress={SampleFunction.bind(item)}>{item}</Text>
</Animated.View>
);
})}
However, the array starts at the beginning of the screen. I want the first element of this array to start in the center. How can I achieve that?