2

I'm using this RoundedCorners library (based on Romain Guy's post) which allows to set both outline border and a rounded rectangular image to an imageView .

I need to add an outer shadow (meaning it's outside of the image being shown) to the image that is shown (say ,to direction south-east) . I've decided that since the border is the larger part of what is shown, I would add the shadow to it instead of to the image, using the next extra code in RoundedDrawable :

mBorderPaint.setShadowLayer(shadowRadius, shadowDx, shadowDy, shadowColor);

Of course, I've also added the fields and populated them with values.

Problem is, the shadow seem to ignore the dx,dy values i've given it, and it's just setting the background to the entire imageView .

I've read here and some people claim that using setShadowLayer on new android API (from 11+) won't work except on texts because it tries to use the GPU , but I've tested it on API10 too and it had the same result.

How could it be? What should I do in order to fix it or use an alternative?

I assume I could add a new paint like the one used for the border, but this would mean I need to change a lot more code that depends on it too (or actually I need to do it anyway? ) . Plus, i might make it a little uglier than what is shown for real shadows.

4

0 に答える 0