eclipse 错误:Android Studio 中必须有透明或白色的一像素框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25602149/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error:Must have one-pixel frame that is either transparent or white in Android Studio
提问by BST Kaal
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 Studio。几乎每隔一秒,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 中。
回答by mittelmania
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.pngfiles to .pngfiles
Android 使用一种称为 9-Patch 的图像格式,它允许您在图像中定义可拉伸区域(您可以在此处阅读更多相关信息)。要解决您的问题,请为您的 png 图像添加一个 1 像素厚的外部透明框架,或者只需将它们从.9.png文件重命名为.png文件