Alex Rivera | Logout

Eclipse bug with nine patch files?

Asked 2010-12-03T16:14:07.063
9

I tried to convert all my buttons background to .9.png, but I have a problem with Eclipse.

I created my nine patch .png with the tool, but since I put it in my /res/drawable folder, I have the following errors in all my .xml files when I try to access any resource starting with @drawable:

Error: No resource found that matches the given name (at 'drawable' with value '@drawable/my_resource').

Here is my .9.png: nine patch

And here is a screenshot: screenshot

Is there a problem in my .9.png or is it a problem with eclipse?

Thanks

Edit
Report

2 Answers

8

I don't know for sure that it's what's causing the problem, but in your NinePatch, you need to make the right and bottom part of the frame into solid lines. The right and bottom define your content area (i.e. where Android will place content within the NinePatch. It can't be a discontiguous area.) The top and left define your stretch points. Since it's a gradient, I would go ahead and just connect the dots on all sides except the top. The top, you can just use a single black pixel to achieve the same result.

answered 2010-12-03T16:18:25.993
0

For working perfect try to close and open 9patch after modification.

it preferebly to close 9patch for each modifcation image, and re open 9patch for the new image that you want streatch with 9patch.

answered 2013-02-19T18:08:56.203

Your Answer