Nine Patch stretchable Images

Android supports a stretchable bitmap image, called a NinePatch graphic. This is a PNG image in which you define stretchable sections that Android will resize to fit the object at display time to accommodate variable sized sections, such as text strings. You typically assign this resource to the View's background. An example use of a stretchable image is the button backgrounds that Android uses; buttons must stretch to accommodate strings of various lengths.

Source file format: PNG — one resource per file

Resource source file location: res/drawable/some ^ame.9.png (Filename must end in .9.png) Q^ Compiled resource datatype: Resource pointer to a NinePatchDrawable. Resource reference name:

For more information and examples using NinePatch drawables, see the discussion in 2D Graphics.

0 0

Post a comment