Lonli-Lokli Lonli-Lokli - 6 months ago 46
Android Question

Why nine-patch is scaled horizontally

As an addition to my previous question, I have a image and want to place text inside the image. I've created a

image but it scaled incorrectly - I want to leave part of the image unchanged.

original file

enter image description here

It's how it looks in editor

enter image description here

this how it looks in preview (and in my sample app with width more than image width

enter image description here

So I want to scale only text part and leave the 'head' and 'fingers' unchanged.


The upper part (black border) tells the 9 patch to stretch the "head part" too.

Please consider using two pixels at the sides of the "no stretch zone".
Something like: . .
This way you'd have 2 horizontally stretched areas, leaving the head unstretched.


At last, I saw you put the image, so here's my patched version, just in case.

enter image description here