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

191
Vistas
react native items not align vertically center

I am trying to center the items of flatlist using alignItems but none of justifyContent, alignItems is working on this

<View style={styles.citiesContainer}>
                    <FlatList
                        data={cities}
                        renderItem={renderItem}
                        keyExtractor={item => item}
                        horizontal={true}
                    />
                </View>
                
// styling part
const styles = StyleSheet.create({
citiesContainer: {
        height: 110,
        justifyContent: 'center',
        alignItems: 'center',
        width: '100%',
        backgroundColor: 'red'
    }
  }

Check those black circles in the red box in the image, I want to vertically center those circles (items)

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

try https://reactnative.dev/docs/flatlist#columnwrapperstyle

                    <FlatList
                        columnWrapperStyle={styles.citiesContainer}}
                        data={cities}
                        renderItem={renderItem}
                        keyExtractor={item => item}
                        horizontal={true}
                    />
about 4 years ago · Juan Pablo Isaza Denunciar

0

change the flex direction will do, try flexDirection : 'row'

const styles = StyleSheet.create({
citiesContainer: {
        height: 110,
        justifyContent: 'center',
        alignItems: 'center',
        width: '100%',
        flexDirection : 'row', //this right here!! :)
        backgroundColor: 'red'
    }
  }
about 4 years ago · Juan Pablo Isaza Denunciar
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