Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!