How to emulate CSS column columns in React-Native?

With CSS columns, you can wrap images and divs across multiple columns. For example, if you configured your CSS file like this:

html,
body {
    height: 100%;
}
body {
    overflow: hidden;
    margin: 0;
    background-color: orange;
}
#master-container {
    height: 100%;
    column-count: 2;
}
#child-container {
    height: 200%;
    width: 100%;
    background-color: cadetblue
}
.child-element {
    height: 33%;
    width: 100%;
    background-color: crimson;
    margin-bottom: 15px;
}

      

And HTML like this:

<!doctype html>
<html>

    <link rel="stylesheet" href="index.css">

<body>

<div id="master-container">
    <div id="child-container">
        <div class="child-element"></div>
        <div class="child-element"></div>
        <div class="child-element"></div>
    </div>
</div>

</body>

</html>

      

This is the result: https://codepen.io/MichaelMC/pen/WpPOxo

I want to achieve the same effect on mobile with React-Native. Does anyone know how this CSS-count function actually works? Some kind of Pac-Man / Asteroids style graphic trick? Duplicate items?

+3


source to share





All Articles