Search code examples
androidnine-patch

Bad 'Patches' in 9-Patch File


I'm attempting to use the Draw9Patch tool from the Android SDK, but immediately upon opening my image with Draw9Patch it shows all of my image area as a 'Bad Patch.' I manually drew in the lines that define the stretchable areas, however I am unsure if this will work properly. Could someone explain why this specific image is not a 'good patch'? Other Stackoverflow answers to this question do not seem to correlate to my problem or I am not understanding them.

Example of Draw9Patch Bad Patches Original Image


Solution

  • Old, but I had the same question. The "bad patch" thing is definitely confusing, but won't stop your drawable from working. The dev sites says it's basically a warning that those patch sites "may produce artifacts in the graphic when stretched"‌​.

    If you look at a lot of the stock Android drawables you'll see that they contain "bad patches". So just test them out and if they look fine I wouldn't worry about it.