O'Reilly logo

Android UI Design by Jessica Thornsby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with 9-patch images

A 9-patch graphic is a stretchable bitmap that allows you to define which areas the system can and can't stretch when it needs to resize your image to fit the current screen.

When you convert a regular image into a 9-patch image, you add an extra 1-pixel-wide border around your image's top and left areas. This 1-pixel border pinpoints exactly which pixels the system should replicate if it needs to create a stretched effect rather than simply resizing the entire image:

Working with 9-patch images

Your border doesn't have to be a continuous line; if there's any area you don't want the system to stretch, just leave the area as a gap in your border. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required