Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
ScrollView cut off in React Native

I have encountered a problem. ScrollView is cut off at the bottom of the screen on both Android and iOS. It's "unscrollable". My code is rather simple:

 <View style={{ flex: 1 }}>
          <ScrollView style={styles.container}>
            <Image
              style={styles.image}
              source={{ uri: constants.media_url + "/" + data.img }}
            />

            <Text style={styles.title}>{data.heading}</Text>
            <Text style={styles.published_date}>{data.published_date}</Text>

            <Text style={styles.introduction}>
              {stripHTML(data.introduction)}
            </Text>
            <RenderHtml contentWidth={width} source={source} />
          </ScrollView>
        </View>
const styles = StyleSheet.create({
  container: {
    backgroundColor: colors.background,
    padding: 10,
    flex: 1,
  },
  image: {
    width: "100%",
    maxHeight: 270,
    height: "100%",
  },
  title: {
    fontSize: 24,
    marginTop: 20,
    fontWeight: "bold",
  },
  introduction: {
    fontWeight: "bold",
  },
  text: {
    fontWeight: "normal",
    marginTop: 13,
  },
  published_date: {
    color: colors.gray,
    marginVertical: 10,
  },
});

As you can see I have used flex tricks, I've also tried padding, everything. It just doesn't work. I use only two libraries in my project: "react-native-render-html": "^6.3.4", and React Navigation.

Thank you!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So, after hours of searching and trying, literally, I have done it.

<View style={{ flex: 1 }}>
          <ScrollView
            style={styles.container}
            contentContainerStyle={{ flexGrow: 1, paddingBottom: 300 }}
          >
            <Image
              style={styles.image}
              source={{ uri: constants.media_url + "/" + data.img }}
            />

            <Text style={styles.title}>{data.heading}</Text>
            <Text style={styles.published_date}>{data.published_date}</Text>

            <Text style={styles.introduction}>
              {stripHTML(data.introduction)}
            </Text>
            <RenderHtml contentWidth={width} source={source} />
          </ScrollView>
        </View>

What I changed is I added contentContainerStyle={{ flexGrow: 1, paddingBottom: 300 }} to my ScrollView component. For me 300 worked, maybe you can change according to your needs.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!