错误:Android Studio中必须具有透明或白色的单像素帧

时间:2021-11-08 11:12:07

I have just imported a project from eclipse to Android studio. Almost for every second image , android studio is giving the following error.

我刚刚从eclipse导入了一个项目到Android工作室。几乎每一个图像,android studio都会出现以下错误。

Error:Must have one-pixel frame that is either transparent or white.

I am trying to edit my images for last few hours, but couldn't do it. Can anyone guide me whats the best solution for it.

我想在最近几个小时编辑我的图像,但是无法做到。任何人都可以指导我最好的解决方案。

Why its in only Android Studio why not in Eclipse.

为什么它只在Android Studio中为什么不在Eclipse中。

1 个解决方案

#1


This is shown because you're trying to edit 9-Patch images that don't have the appropriate 1-pixel border.

之所以显示,是因为您正在尝试编辑没有合适的1像素边框的9-Patch图像。

Android uses an image format called 9-Patch which allows you to define stretchable areas in an image (you can read more about it here). To fix your problem, either add an outer 1-pixel thick transparent frame to your png images or simply rename them from .9.png files to .png files

Android使用称为9-Patch的图像格式,允许您在图像中定义可伸缩区域(您可以在此处阅读更多相关信息)。要解决您的问题,请在png图像中添加一个外部1像素厚的透明框架,或者只需将它们从.9.png文件重命名为.png文件

#1


This is shown because you're trying to edit 9-Patch images that don't have the appropriate 1-pixel border.

之所以显示,是因为您正在尝试编辑没有合适的1像素边框的9-Patch图像。

Android uses an image format called 9-Patch which allows you to define stretchable areas in an image (you can read more about it here). To fix your problem, either add an outer 1-pixel thick transparent frame to your png images or simply rename them from .9.png files to .png files

Android使用称为9-Patch的图像格式,允许您在图像中定义可伸缩区域(您可以在此处阅读更多相关信息)。要解决您的问题,请在png图像中添加一个外部1像素厚的透明框架,或者只需将它们从.9.png文件重命名为.png文件