Skip to content Skip to sidebar Skip to footer

Multiple Layers Of Shadows In Android Recyclerview Elevation

I have a recyclerview with an elevation of 8dp, transparent background and bounds as outlineProvider. clipToPadding is set to false on the parent relativelayout. I am facing a wei

Solution 1:

The first shadow is cast by the RecyclerView, the second is cast on top of the RecyclerView by the first ImageView child. Both shadows look fine. Maybe you can highlight the part of the image which is not correct according to you?

Solution 2:

The shadow is not on the top but behind the RecyclerView. This shadow is visible because you have transparent background of the RecyclerView. The shadow is rendered under the RecyclerView but not the whole surface is painted, just some area around the edges.

This might be an optimisation or a side effect, I'm not sure, but I've been observing this 'effect'. I guess this is normal and intended. If you make a solid backgound color, the not nice part will be covered.

Post a Comment for "Multiple Layers Of Shadows In Android Recyclerview Elevation"