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

168
Views
React Native: Scrollview won't scroll with row direction and flexWrap

in my react-native app I have a scrollview where my list items are row wrapped (flexDirection:'row',flexWrap:'wrap'), however because of this my scrollview won't scroll for some reason...

My scrollview:

 <View style={{flex:1}}>
                <ScrollView vertical={true} contentContainerStyle={{ borderWidth:1,flex:1,flexDirection:'row',flexWrap:'wrap',alignItems: 'flex-start'}}>
                {root.userStore.passionOptions.map((item,index) => {return (
                        <Text key={item} onPress={ ()=>{ Alert.alert('kaka') } } style={{ fontSize:18,padding:5,paddingLeft:10,paddingRight:10,color:'rgb(125,125,125)',borderRadius:35,borderWidth:1,borderColor:'rgba(0,0,0,0.1)',margin:5 }}>{item}</Text>
                        )
                    })}
                </ScrollView>
                </View>

EDIT:I tried removing flexWrap and flexDirection property and it won't scroll neither

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

0

Reason not to work:

Your flexDirection is conflicting with ScrollDirection.

Solution:

So to avoid conflict you can have another View inside ScrollView and do the flexWrap logic

<ScrollView>
  <View
    style={{ 
      borderWidth:1,
      flex:1,
      flexDirection:'row',
      flexWrap:'wrap',
      alignItems: 'flex-start' 
    }}
  >
    ...Your Views over here...
  </View>
</ScrollView>
about 4 years ago · Juan Pablo Isaza Report

0

It works for me like this i made the scrollView the outter component

<ScrollView>
  <View
    lightColor="#eee"
    style={{ paddingHorizontal: 7, paddingVertical: 5 }}
  >
    {children}
  </View>
</ScrollView>
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!