Search code examples
javaandroidspinnernine-patch

Android - 9 patch


I'm trying to create a new spinner background using a 9 patch picture. I've tried many ways to get a perfect image but I failed :s

Here is my 9 patch: enter image description here

The content looks to be good when I simulate with Draw-9-patch but the part with the arrow is not displayed, or when it is, this part is totally mal-formed.

I've put the top black line to the whole size and the problem is still the same.

Do you know how to solve it?

Thanks.

Regards.

V.


Solution

  • First of all, you've marked your rounded corners as stretchable, this should be avoided so your corners stay the same, no matter how its stretched. You've also marked your arrow as being stretchable vertically, which I suppose is not desirable.

    See the attached image for a fixed 9-patch (note the differences in 9-patch frame compared to your image), this should scale well in all directions.9-patch dropdown