Has anyone one else attempted to achieve this effect in React Native?:
A component with a solid shadow effect to give an illusion of depth.
As you may know React-Native does not support CSS box-shadow
. It does have a very close equivalent though, the shadowOffset
property, which only works on iOS (What was used for the above example). And from what I gather Android’s elevation
property does not have a setting for blur radius to have it be solid.
I have tried the react-native-shadow
and the react-native-shadow-2
packages. Both seem to have problems shadowing the actual component, it instead does it to the margins and doesn’t seem to handle borderRadius
either. Maybe missed something.
The closest cross-platform solution I could get was to add a thicker bottom borderWidth
. But as you can see the appearance is still a bit off:
If you have a solution for this design problem on Android, please lmk. There is no way there isn’t a simple way to get such a simple effect, right?