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

403
Vistas
React Native - How to Build an Image Grid like FaceBook

I am looking to create an app using React Native and need a list of images to be arranged and displayed just like facebook activity photos.

In short, I want to create the react-native version of https://taras-d.github.io/images-grid/

Does anyone know a RN Component that offers something similar ?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can create image grid yourself by setting width height for each image and render it in a row.

For example, You want 3 images for 1 row. You can use dimensions to get windows width and divide for 3.

const windowWidth = Dimensions.get('window').width;
var IMAGES_PER_ROW = 3;

calculatedSize(){
  var size = windowWidth / IMAGES_PER_ROW
  return {width: size, height: size}
}

After that, we will render images in a row.

renderRow(images) {
    return images.map((uri,i) =>{
      return(
        <Image key={i} style={[styles.item, this.calculatedSize()]} source={{uri: uri}} />
      );
    })
  }
  renderImagesInGroupsOf(count) {
    return _.chunk(IMAGE_URLS, IMAGES_PER_ROW).map((imagesForRow,i) => {
      return (
        <View style={styles.row} key={i}>
          {this.renderRow(imagesForRow)}
        </View>
      )
    })
  }

You can set image grid margin like you want in styles.item like margin: 1.

Full example here

over 4 years ago · Santiago Trujillo 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