9-patch drop shadow disappears when image nears the edge

前端 未结 1 1524
时光取名叫无心
时光取名叫无心 2021-01-07 08:44

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):

相关标签:
1条回答
  • 2021-01-07 09:19

    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

    0 讨论(0)
提交回复
热议问题