Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set elevation color?

We have the proptype elevationin react-native (doc), but how can I set the color of the "android-shadow" it's producing?

like image 651
dv3 Avatar asked Sep 15 '16 14:09

dv3


People also ask

How do you set the color in elevation?

As per @rclai Answer, You cannot change the Elevation color in Android.

How to set elevation 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.

How do you give elevation color in flutter?

To set specific shadow color for ElevatedButton widget, set shadowColor property in ButtonStyle set to style property of this ElevatedButton with required Color value.

How do I change the color of my card shadow?

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.


1 Answers

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.

like image 100
Gauthier Avatar answered Oct 20 '22 09:10

Gauthier