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

285
Visualizações
React-Native FlatList takes more space than needed

I have a simple compoenent set up as to demonstrate my issue.

I have a base component BaseScreenCenterTop

const BaseScreenCenterTop = ({ children, ...props }) => {
  return (
    <View style={[styles.container, props.style]}>
      {children}
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    display: 'flex',
    flex: 1,
    flexDirection: 'column',
    alignItems: 'center',
    justifyContent: 'flex-start',
    width: '100%',
    height: '100%',
    paddingVertical: 30
  },
})

and my main component:

<BaseScreenCenterTop>
  <View style={{backgroundColor: 'green', height: 30, width: '100%'}}>
  </View>
  <View>
    <FlatList
      data={doc.items}
      renderItem={({ item }) => renderItem(item)}
      keyExtractor={item => item.id}
    />
  </View>
  <View>
    <Button
      title="Test"
    />
  </View>
</BaseScreenCenterTop>

The result I get is:

Actual screen render

And I want the FlatList to get the full height, but still have the Button visible at the end.

I tried many things to fix this, but it seems that the FlatList just sets its height to the maximum it can get until the end of the view, ignoring that there is stuff after it.

Thank you!

about 4 years ago · Juan Pablo Isaza
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