ninepatch

Advanced 9Patch drawing in android

SDK Version: 
M3

Drawing 9patch can turn into a nightmare easily. I would like to present the other side. The most common problem, to create draws wich are look well in portrait mode and landscape mode too.

Here are some 9patch technics:

(Note: This article don’t tell the basics of 9patching. If you are new in this technics, examine this page first: http://developer.android.com/guide/developing/tools/draw9patch.html)

(From this link, you can download the files: download the 9patch files)

Example One: Simple button
This is a just simple button, with a glowing effect. The 9patching wich I use here, keeps the button’s edges, so it keeps the rounded rectangle’s radius too. With 9patch, the content area of the button can be set easily.

draw9

Syndicate content