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
  • 245,468
  • 26
  • 309
  • 415
Toto NaBendo
  • 290
  • 3
  • 26

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,841
  • 1
  • 16
  • 22
-1

please change the style of icon and give opacity to 0

savan patel
  • 254
  • 1
  • 5