Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda