Skip to content Skip to sidebar Skip to footer

9-patch Drop Shadow Disappears When Image Nears The Edge

I'm using 9-patch to produce drop shadow for a box. If the image width is at 280dp (20dp off the edge of the box), I get a good drop shadow (@315 degrees): However, if I make the

Solution 1:

Reduce your top and left black border to 1 px (the stretchable area).

Like so:

enter image description here

Optionally, you can also reduce the right and bottom black border by some pixels (to introduce some padding).

Like so:

enter image description here

Optionally, you can add some blank (transparent) space (let's say 4px per side) between the image (shadow included) and the black borders. This will add some padding.

OR

You can add some padding to your RelativeLayout

Post a Comment for "9-patch Drop Shadow Disappears When Image Nears The Edge"