We have the proptype elevation
in react-native (doc), but how can I set the color of the "android-shadow" it's producing?
As per @rclai Answer, You cannot change the Elevation color in Android.
To set the default (resting) elevation of a view, use the android:elevation attribute in the XML layout. To set the elevation of a view in the code of an activity, use the View. setElevation() method. To set the translation of a view, use the View.
To set specific shadow color for ElevatedButton widget, set shadowColor property in ButtonStyle set to style property of this ElevatedButton with required Color value.
Use Fake Shadow. xml ) in the parent layout which is looking like a shadow. You can replace FF46A9 in shadow. xml to change the color of shadow. Also android:backgroundTint="@color/colorShadow" works but you have to adjust colors alpha in shadow.
You can change shadow colors on Views starting API 28 (Pie) with View#setOutlineAmbientShadowColor(int color) and View#setOutlineSpotShadowColor(int color) if you use elevation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With