Pages

NinePatch Images

Any of the existing image files in \res\drawable that are named  xxxxx.9.png  are ninepatch images.
 
Four small things that caught me out:
1) you can't have two images with the same root name e.g. abc.png and abc.9.png
2) when you reference them in Java the .9 element is not present (related to issue 1) e.g.  R.drawable.abc would automatically reference the abc.9.png image
3) The border has to be white with the "stretchable" elements in black 
4) When you change the content of an image you have to hit F5 to refresh the \res folder - even though the filename hadn't changed - in order for the new content to appear in the application.
 
Finally, don't bother looking at the nine-patch images in the XML Editor in Layout mode - they don't stretch properly.


NinePatch Resources
NinePatch Tools