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

268
Views
How do you arrange shapes in React Native?

I am attempting to arrange squares just like how they look in the image, but I can't really figure out the whole flex and positioning stuff: squares

This is probably really simple but I just can't figure it out.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Well, here is a quick and dirty version of your picture.

import React from "react"
import { StyleSheet, View } from "react-native"

export const Test = () => {
  return (
    <View style={styles.container}>
      <View style={styles.row}>
        <View style={[styles.square]} />
        <View style={[styles.square]} />
        <View style={[styles.square, { backgroundColor: "yellow" }]} />
        <View style={[styles.square, { backgroundColor: "turquoise" }]} />
      </View>
      <View style={styles.row}>
        <View style={[styles.square, { backgroundColor: "red" }]} />
        <View style={[styles.square, { backgroundColor: "blue" }]} />
        <View style={[styles.square, { backgroundColor: "green" }]} />
        <View style={[styles.square, { backgroundColor: "violet" }]} />
        <View style={[styles.square, { backgroundColor: "yellow" }]} />
      </View>
      <View style={[styles.square, { backgroundColor: "lightgrey", height: 25, width: 300 }]} />
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    display: "flex",
  },
  row: {
    flexDirection: "row",
  },
  square: {
    width: 60,
    height: 60,
  },
})

which yields to the following view.

enter image description here

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!