本文介绍了在Android的9补丁图像错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试添加了9片图像到\绘制文件夹在我的项目,我得到了同样的错误:

Whenever I try to add a 9-patch image to \drawable folder in my project, I get the same error:

ERROR:9片图像C:\水库\绘制\ appwidget.9.png畸形。帧的像素必须是固体或透明(未中间阿尔法)。在像素#3沿顶边找到的。故障处理PNG图像C:\水库\绘制\ appwidget.9.png

ERROR: 9-patch image C:...\res\drawable\appwidget.9.png malformed.Frame pixels must be either solid or transparent (not intermediate alphas).Found at pixel #3 along top edge.Failure processing PNG image C:...\res\drawable\appwidget.9.png

怪异的事情在本例中,我已经得到了从SDK中找到资源的Android的G1-偶像形象这一形象,所以它应该是好的。同样的事情发生任何我到目前为止已经试过9片图像。什么地方出错了?

The weird thing in this example is that I've got this image from the "android-g1-icon" images found in the sdk resources, so it is supposed to be ok. The same happened with any 9-patch image I've tried so far. What could be wrong?

推荐答案

这是最新的ADT是20.0.3的问题。也可以重命名的* .9.png为*。PNG,开始工作。我认为这是只与ADT的错误,因为对于18.0.0版本ADT它没有提示这种类型的错误,并能正常工作

this is the problem with latest adt that is 20.0.3. you can instead rename the *.9.png to *.png and start working. i think this is the bug with the adt only, since for 18.0.0 version adt it doesnt prompts for this type of error and works fine

这篇关于在Android的9补丁图像错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 00:55
查看更多