-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transparent backgrounds #16
Comments
if this is solved, it would be probably the #1 library to go for shadows. will try to solve it |
Hi @terrysahaidak, I think you can achieve what you want with <View style={{ opacity: 0.5, padding: 20, margin: -20 }} renderToHardwareTextureAndroid>
<ShadowedView
style={{
width: 150,
height: 200,
borderRadius: 20,
backgroundColor: '#dbfff2',
...shadowStyle({
opacity: 0.4,
radius: 12,
offset: [5, 3],
}),
}}
/>
</View> The 20px padding needs to be adjusted based on the radius/offset of the shadow. Let me know if it doesn't work as you would expect. |
Solved my issue with renderToHardwareTextureAndroid. Thanks |
Is your feature request related to a problem? Please describe.
In react native on Android when you use elevation and want to have a transparent-ish view, you will have visible shadow background:
https://snack.expo.dev/@terrysahaidak/humiliated-strawberries
This library implements really cool shadows but also suffers from this same problem - the shadow is visible underneath.
This is a known problem of React Native, though:
facebook/react-native#25093
Describe the solution you'd like
At this point, I don't know if this is actually possible.
According to the issue, it wasn't a problem until Android 9.
P.S.
Thanks for this awesome library, it's a gem!
The text was updated successfully, but these errors were encountered: