0

I'm attempting to create customs buttons using icons instead of text, and this requires the background property of each button view to utilise a nine patch image, where everything bar the icon can be scaled.

When I select my nine patch image, the WYSIWYG editor displays it as it should (http://i.imgur.com/rXYWQnf.png) but when compiled to either the emulator or a device, the image is scaled like a normal .png but with the nine patch lines visible (http://i.imgur.com/duwKJ10.png)

I have performed multiple clean & rebuilds, as well as moving the swinglabs jar into the lib folder of the tools directory, but still it doesn't seem to work. I'd be happy to provide any other information you may need to answer this question, the things become the bane of this app!


My images were created through the draw9patch tool and saved with the .9.png postfix via the tool


Thanks Guys! It was my mistake in not quite understanding the nine patch scale/fill relationships in the top/left and bottom/right 1px lines, thanks again! - Ciaren Coleman

4

3 回答 3

0

在此处输入图像描述您的九个补丁中缺少顶线,这就是问题所在,顶部应该有一些像素来告诉您像您在左侧所做的那样拉伸什么。没有顶部和左侧线九个补丁是不完整的。

检查链接在此处输入链接描述

于 2013-08-22T12:05:06.087 回答
0

在此处输入图像描述

请检查此图像以放入您的代码。9patch 中制作了简单的图像。再次检查此图像

于 2013-08-22T12:10:16.783 回答
0

图片名称应如下所示

xxx.9.png

只有android才知道这是九路图

于 2013-08-22T11:58:15.060 回答