Eclipse的错误与九个补丁文件? [英] Eclipse bug with nine patch files?

查看:178
本文介绍了Eclipse的错误与九个补丁文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图把我所有的按键背景.9.png,但我有一个问题与Eclipse。

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

我创造了我的九个补丁巴纽与工具,但因为我把它放在我的/ RES /绘制文件夹,我在我所有的.xml文件下面的错误,当我尝试访问任何资源开始@drawable:

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').

下面是我的.9.png:

Here is my .9.png:

下面是截图:

And here is a screenshot:

有没有在我的.9.png一个问题,或者是Eclipse问题?

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

感谢

推荐答案

我不知道是肯定的,这是什么导致这个问题,但在你的NinePatch,你需要做出正确的和框架的底部成固体行。右侧和底部的定义内容区域(即其中,Android将放置NinePatch中的内容。这不可能是一个不连续区域)的顶部和左侧定义你的伸展点。因为这是一个梯度,我会继续前进,只是连接点上的各方面,除了顶部。在顶部,你可以只使用一个单一的黑色像素来达到同样的效果。

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.

这篇关于Eclipse的错误与九个补丁文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆