'Shadow color android studio
I have a ui design. I should to make some xml file with custom shadow color.
I used to carbon library but it not work very well
I need to create shadow like this enter image description here
Solution 1:[1]
This should work for Android version 28 or higher.
In your xml layout, include this in your CardView.
android:outlineAmbientShadowColor="<yourColor>"
android:outlineSpotShadowColor="<yourColor>"
You can do the same in code by doing this:
mCardView.setOutlineAmbientShadowColor(ContextCompat.getColor(getContext(), R.color.color_blue));
mCardView.setOutlineSpotShadowColor(ContextCompat.getColor(getContext(), R.color.colour_blue));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | IODevBlue |
