0

I'm trying to make an overlay View within opacity, and I would like to remove the opacity on a child element see the picture :

enter image description here

<View style={styles.layer} pointerEvents={"none"}>
    <Component {...props}/>
</View>

const styles = StyleSheet.create({
    layer: {
        opacity: 0.5,
        flex: 1
    }
});

I tried to :

  • Set the children opacity to 1 : No effect,
  • Set rgba values to parent and children with different alpha value: I lost the opacity on the parent layer

How to handle that

Temani Afif
  • 211,628
  • 17
  • 234
  • 311
Toto NaBendo
  • 220
  • 2
  • 23

2 Answers2

0

You cannot make a child element less transparent than the parent, without some trickery:

https://css-tricks.com/almanac/properties/o/opacity/

PoseLab
  • 1,733
  • 1
  • 15
  • 19
-1

please change the style of icon and give opacity to 0

savan patel
  • 208
  • 1
  • 5