Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to use shadowOpacity in react native for android?

Shadow style works fine for iOS but on Android only elevation works and I can't add style to it? So is there any way to add shadowOpacity, shadowColor, shadowOffset ... etc?

like image 700
user3215945 Avatar asked Oct 23 '25 12:10

user3215945


1 Answers

If it can help someone today (it's been a while) :

It is possible to give elevation and a shadowColor on android, if you use rgba colors you can add transparency, here I put 0.5 for opacity :

  myStuff: {
    width: 50,
    height: 50,
    elevation: 5,
    shadowColor: 'rgba(152, 152, 152, 0.5)',
  },
like image 52
peter beautiful-side Avatar answered Oct 26 '25 03:10

peter beautiful-side



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!