2

Can you help me with a solution for custom color shadow with gradient effect?

I need this effect for ImageView shadow

enter image description here

For example, I try to use gradient like:

              <gradient
                android:type="radial"
                android:startColor="#000000"
                android:endColor="#43bababa"
                android:gradientRadius="100dp"
                android:angle="270"/>

enter image description here

But this gradient has ring effect, not rounded corners.

Leonid Veremchuk
  • 1,952
  • 15
  • 27

1 Answers1

-1

There's problem in every possible solution:

About shadows:

  1. You can use CardView. It has rounded corners and shadows out of the box. But as I know compat realization doesn't cut corners of inner layouts. It just fits image in it (as result tiny white strokes around image example)
  2. You can use 9 patch image as background. Not so easy to place layout layers correctly

SOLUTION YOU WILL LIKE: Use CardView with RoundedImageView

Romadro
  • 626
  • 4
  • 10