androidnine-patch

Why is this a bad PNG for 9-Patching?


It seems every attempt I've made at creating a 9-Patch file has created a situation where the 'Content' in the Draw 9-Patch is always 'Bad'. Here is my latest (and very simple) PNG that is shown as all bad pixels:

Bad PNG Content

Could I please be enlightened as to why this is 'bad'? And how am I suppose to know what is good or bad if Android does not explicitly state any criteria in the SDK docs?


Solution

  • This PNG is fine. What you're supposed to do with the draw 9-patch tool is to select the areas which are stretchable. Don't select the two pixel area where your two colors meet. Here's the 9-patch I created from your PNG:

    9-patch