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

213
Visualizações
How to align card-images next to each other in react native

I just started with react native, I wanted to align card images next to each other (react-native-elements) but it does not work for some reason. What I want to achieve is two rows in on phones and 3 rows on tablets. But for some reason my code does not work. First the cards are aligned connected to each other no space between them and on my phone (Iphone 12) it is aligned as a column. Even though I have set flex-direction to row. could someone look at my code and tell me what is wrong?

card-image element

<View style={styles.secondPartOfDisplay}>
        {categories.map((c,i) => {
          return (
                <View key={i} style={{width: 200, height: 150, flexDirection: 'row'}}>
                  <Card.Image >
                <Image
                    style={{width:200,height:150}}
                    resizeMode="cover"
                    source={c.imageSource}
              />
                  </Card.Image>

                </View>
          )
        })}

      </View>

styles:

secondPartOfDisplay: {
    paddingTop: 30,
    display:'flex',
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: "space-between"
  },

And here is the image on how it looks on phone:

Iphone 12 look

This is how it looks on ipad:

this is how it looks on ipad

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If there iis no extra margin or padding that's messing with your container grid, then probably your images are not responsive according to the screen size. You would probably need to set your image height: "100%" and width: "auto" Hope this resolves your issue.

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