1
votes

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?

3

3 Answers

0
votes

As you can see here, those are only available for iOS.
The only way to add shadow on Android is with elevation, like you said.
You can also read about this issue here for more detail.

0
votes

You can use Shadow Props to define shadows on Android now because the issue Vincent referenced was resolved with this Pull Request.

0
votes

As rightly mentioned above

elevation

is the only supported way of adding shadow.

However, there is a third party plugin that can help you out.

https://github.com/879479119/react-native-shadow

Attribute we support now

opacity: the opacity of shadow