Search code examples
androidnine-patch

9-patch - 1px border is blurred


I'm testing on HTC Desire which is a hdpi device. The problem is clear when you look at the image:

9-patch - 1px border is blurred

And here is how my 9-patch (made with standard 9-patch tool) looks (zoomed):

9-patch - 1px border is blurred

The left image is my photoshop file, and the right one is a screenshot from my device. As you can see there is a huge difference. Let's say that the shadow is not THAT important, but the blurred border looks bad.

Is my 9-patch png wrong? What can I do to achieve a nice crisp 1px solid border?


Solution

  • You should use 9-path tool for each png in different drawable folder. Sometimes problem is this the Android try to convert the png and blur the black lines, what cause later problem with properly displaying.