Search code examples
androidnine-patch

9 patch not working well


I have created a simple 9 patch for an android EditText background. It works exactly as expected when I preview the graphical layout in eclipse.

The problem is that when I install the app on the device, the said EditText is horribly scaled, almost indistinguishable.

What could be the problem?


Solution

  • It probably has garbage (pixels not exactly black) on the 9-patch area (1 pixel border) and hence it doesn't understand it as a 9-patch.

    Save this image with the draw9patch tool and clean your project before building it!