Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse bug with nine patch files?

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

like image 865
nbarraille Avatar asked Dec 03 '10 16:12

nbarraille


1 Answers

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.

like image 56
Kevin Coppock Avatar answered Sep 26 '22 13:09

Kevin Coppock