Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16553

How to have two views in a row that take 50/50 and have different background colors?

$
0
0

I am trying to create a small indicator(view) that changes background colour according to its severity. Imagine a square that takes 50/50, where one has red colour and the other a white colour.

I have done this currently.

This is what i have done ^|. Now imagine that the green colour is white, and i just need to show the red colour which is basically changing the background colour according to a prop (severity level).

What i don't want

What happens is that if i set the the other colour to white it doesn't work on android but iOS works just fine/ Also this only happens when the parent container's opacity is set to anything less than 1. As you see in the image above it gets blueish..


Viewing all articles
Browse latest Browse all 16553

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>