0

I created a set of 8 boxes. I used flexbox to position them. The boxes will not all fit on the screen so I added a to vertically scroll through them. But somehow it won't work. Only 8 boxes are shown and I cannot scroll down to see the rest. I am frustrated.

Any ideas what is wrong here?

Here is my code:

<View style={styles.background}> 
      <ScrollView style={styles.scrollView}>
             <View style={styles.LessonBoxRow}>
            <Animated.View
              entering={FadeInDown.delay(300).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
              <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
             <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
              <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
              <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
              <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
             <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
              <LessonBox/>
            </Animated.View>
            <Animated.View
              entering={FadeInDown.delay(400).duration(200)}
              easing={Easing.bezier(0.5, 0.01, 0, 1)}
            >
             <LessonBox/>
            </Animated.View>
            </View>
      </ScrollView>
      </View>
  );
}

const styles = StyleSheet.create({

  scrollView: {
    backgroundColor: 'pink',
    flex: 1,
  },
  LessonBoxRow: {
    flexDirection: "row",
    justifyContent: "space-evenly",
    top: 140,
    flexWrap: "wrap",
    marginTop: 10,
  },

  background: {
    height: "100%",
  },

});
Twos22
  • 57
  • 1
  • 11
  • You'd significantly increase your chances of getting a useful answer by creating a *runnable* [mcve]. Consider [importing](https://codesandbox.io/docs/learn/getting-started/your-first-sandbox#import-local-projects-via-cli) your project into codesandbox or similar. Also it's not clear the ScrollView actually has `display: flex`. Where are you setting it? – tao Dec 19 '22 at 11:53
  • Does this answer your question? [ScrollView with flex 1 makes it un-scrollable](https://stackoverflow.com/questions/46805135/scrollview-with-flex-1-makes-it-un-scrollable) – tao Dec 19 '22 at 11:55
  • Hey - sorry if the question is hard to follow. I will try to do better in the future! I made a small change to it. I also found a solution to my problem. I did not use the `contentContainerStyle` prop for ``. I fixed that and now it works :-) – Twos22 Dec 19 '22 at 20:05
  • It's not hard to follow. I was pointing out chances of getting useful answers decrease proportionally with the amount of work required from someone who wants to help. – tao Dec 19 '22 at 20:54

0 Answers0