Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

Chapter 23  XML Drawables


Repeat the process with the pressed version. Run BeatBox to see your new 9-patch image in action
(Figure 23.11).


Figure 23.11  New and improved


So the top and left borders of your 9-patch image indicate the areas of the image to stretch. What about
the bottom and right borders? You can use them to define an optional content region for the 9-patch
image. The content region is the area where content (usually text) should be rendered. If you do not
include a content region, it defaults to be the same as your stretchable region.

Free download pdf