Reputation: 1934
I tried to create a 9 path drawable for a chat bubble
I want the image to extend vertically and have the little arrow unchanged.
I followed a few tutorials and added patches to the image then saved it as bubble.9.png but it doesn't work properly in my app. here is a screen shot
What am I doing wrong?
Upvotes: 0
Views: 400
Reputation: 479
9-patch drawable needs both horizontal and vertical patches. Your bubble is missing markers on top and bottom lines of image.
Here is quick sample of working 9-patch:
More info can be found in official documentation http://developer.android.com/reference/android/graphics/NinePatch.html
You may also try to use official tool for editing 9-patches http://developer.android.com/guide/developing/tools/draw9patch.html . It has live preview and it can automatically convert normal image to 9-patch by adding border pixels. You will only need to mark necessary content and stretch areas.
Upvotes: 1