Search code examples
androidxmleclipsenine-patch

Device doesn't recognize 9 patch


I made some 9 patch images to use as a button, but the device doesn't recognize them.

9 patch image:

enter image description here

How eclipse shows it:

enter image description here

How my device shows it:

enter image description here

As you can see, the english button has two black pixels at the top and slovenian only has one. I did this to try if two pixels would work, but it still didn't.

I'm pretty sure I did everything right. Names are in the right format (name.9.png)


Solution

  • Your problem is that your right border is not continuous. The right border defines the padding, and must be a continuous line (or a single pixel). You seem to simply have the logic inverted, but it should be like this instead:

    9-patch