Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda