-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Not able to set ShadowColor in Android #17226
Comments
I have the same problem right now and still couldn't find any solution by using react-native available features :( |
Not a bug. You cannot set Eleveation Color in Android: Instead of using Elevation you can try this React Native Shadow library which uses svg to produce shadow that let you set color, offset, opacity: |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
@towfiqi I dont want to use any third party library for shadow so I can not use anything which is out of react-native ... and Yes there is no support for android shadowColor in react-native thats why I asked you I tried elevation props but it will stick to gray color as I mentioned in my issue.... Dont know why rn-bot close this! |
@BhavanPatel: Did you update your react-native to latest version? The problem supposed to be solved in the updated version. |
I tried with react-native version 0.54.0 still issue is persist. |
Try adding elevation for Android. |
Hey @BhavanPatel , |
@react-native-bot this issue is still there on Android. |
@react-native-bot the issue is not fixed. I am using 55.4 version of react-native. |
@react-native-bot issue is still there 57.0 |
+1 |
One hack is to create a view and give it the styles that you wish to give to the shadow and set marginTop negative so that it pushes up to the actual component, and some part of it shows up like a shadow, I had to create a button and applied these styles:
|
Is this a bug report?
yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS High Sierra 10.13.1
Node: 8.9.1
Yarn: 0.17.10
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0
Steps to Reproduce
Expected Behavior
Is there way to achieve like this Shadow in Android
as
shadow Props of react-native only supports in iOS
Actual Behavior
See sample code and preview.
It should be work for android too.
Shadow color is always grey however I tried to change.
Please make support for android too.
Reproducible Demo
This is sample snapshot
The text was updated successfully, but these errors were encountered: