Search code examples
react-nativeopacity

how to make color cover the background color?


I tried rgba(156, 39, 176, 1) but it does not cover the color under it. How can I make the purple color circle cover the part of background bell?

enter image description here


Solution

  • First try setting zIndex on the badge to make it render on top. However Android has some zIndex issues, so if that doesn't work then you have to render it after. So you have this right now:

    <View>
       <Badge>
       <Image>
    </View>
    

    You need to do:

    <View>
       <Image>
       <Badge>
    </View>