Home > OS >  How add shadow in the corner of Imagebackground in react-native
How add shadow in the corner of Imagebackground in react-native

Time:09-17

I'm need to add shadow at the corner of the ImageBackground as in WhatsApp to display star. enter image description here

how can this be achieved in react-native.

CodePudding user response:

You need to use Linear Gradient. Add Linear Gradient as last child of ImageBackground. Styles

{
position: 'absolute',
bottom:0,
right:0,
...otherstyles}

And you can add star and text component inside Linear Gradient as its child

<LinearGradient [props]>
 ...star
</LinearGradient>
  • Related