简体   繁体   中英

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 nine-patch image but it scaled incorrectly - I want to leave part of the image unchanged.

original file

在此处输入图片说明

It's how it looks in editor

在此处输入图片说明

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

在此处输入图片说明

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.

[EDIT]

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM